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)) if (!Lua::SafeCall(out, L, 4, 1))
return false; return false;
auto bld = auto bld = Lua::CheckDFObject<df::building>(L, -1);
static_cast<df::building *>(LuaWrapper::get_object_ref(L, -1));
lua_pop(L, 1); lua_pop(L, 1);
if (!bld) if (!bld)