mirror of
https://github.com/autc04/Retro68.git
synced 2024-11-26 06:49:33 +00:00
don't crash on unknown types
This commit is contained in:
parent
2e6fe30d61
commit
afab2466dc
@ -13,6 +13,8 @@ RezWorld::RezWorld()
|
||||
|
||||
void RezWorld::addTypeDefinition(TypeSpec spec, TypeDefinitionPtr type)
|
||||
{
|
||||
if(!type)
|
||||
return;
|
||||
types[spec] = type;
|
||||
}
|
||||
|
||||
@ -34,7 +36,8 @@ void RezWorld::addResource(ResSpec spec, CompoundExprPtr body, yy::location loc)
|
||||
if(verboseFlag)
|
||||
std::cout << "RESOURCE " << spec.type() << "(" << spec.id() << ", " << "\"" << spec.name() << "\"" << spec.attr() << ")" << std::endl;
|
||||
TypeDefinitionPtr def = getTypeDefinition(spec.type(), spec.id(), loc);
|
||||
|
||||
if(!def)
|
||||
return;
|
||||
ResourceCompiler compiler(*this, def, body, verboseFlag);
|
||||
compiler.compile();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user