Fix crash if a Lua avoid aspect returns an invalid value

This commit is contained in:
Celtic Minstrel 2016-03-14 01:49:01 -04:00 committed by mattsc
parent 895a326a70
commit b789391bfb

View file

@ -137,7 +137,10 @@ inline boost::shared_ptr<terrain_filter> lua_object<terrain_filter>::to_type(lua
{
boost::shared_ptr<config> cfg = boost::shared_ptr<config>(new config());
boost::shared_ptr<vconfig> vcfg = boost::shared_ptr<vconfig>(new vconfig(*cfg));
luaW_tovconfig(L, n, *vcfg);
if (!luaW_tovconfig(L, n, *vcfg)) {
cfg->add_child("not");
}
vcfg->make_safe();
boost::shared_ptr<terrain_filter> tf(new terrain_filter(*vcfg, resources::filter_con));
return tf;
}