use Lua::CheckDFObject instead of static cast

develop
Myk Taylor 2020-10-23 15:30:40 -07:00
parent 55a52554ee
commit e614d16e0e
1 changed files with 1 additions and 2 deletions

@ -72,8 +72,7 @@ struct BuildingInfo {
if (!Lua::SafeCall(out, L, 4, 1))
return false;
auto bld =
static_cast<df::building *>(LuaWrapper::get_object_ref(L, -1));
auto bld = Lua::CheckDFObject<df::building>(L, -1);
lua_pop(L, 1);
if (!bld)