mirror of
https://github.com/autc04/Retro68.git
synced 2025-02-18 02:30:48 +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)
|
void RezWorld::addTypeDefinition(TypeSpec spec, TypeDefinitionPtr type)
|
||||||
{
|
{
|
||||||
|
if(!type)
|
||||||
|
return;
|
||||||
types[spec] = type;
|
types[spec] = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,7 +36,8 @@ void RezWorld::addResource(ResSpec spec, CompoundExprPtr body, yy::location loc)
|
|||||||
if(verboseFlag)
|
if(verboseFlag)
|
||||||
std::cout << "RESOURCE " << spec.type() << "(" << spec.id() << ", " << "\"" << spec.name() << "\"" << spec.attr() << ")" << std::endl;
|
std::cout << "RESOURCE " << spec.type() << "(" << spec.id() << ", " << "\"" << spec.name() << "\"" << spec.attr() << ")" << std::endl;
|
||||||
TypeDefinitionPtr def = getTypeDefinition(spec.type(), spec.id(), loc);
|
TypeDefinitionPtr def = getTypeDefinition(spec.type(), spec.id(), loc);
|
||||||
|
if(!def)
|
||||||
|
return;
|
||||||
ResourceCompiler compiler(*this, def, body, verboseFlag);
|
ResourceCompiler compiler(*this, def, body, verboseFlag);
|
||||||
compiler.compile();
|
compiler.compile();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user