use CheckDFObject instead of static cast

Co-authored-by: Alan <lethosor@users.noreply.github.com>
develop
Myk 2020-10-23 13:55:14 -07:00 committed by GitHub
parent 1368fb4003
commit 55a52554ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

@ -303,7 +303,7 @@ static bool construct_planned_building()
return false; 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); lua_pop(L, 1);
if (!bld) if (!bld)