Fix unsafe cast in l_object

This commit is contained in:
rubenwardy 2020-12-23 16:39:29 +00:00
parent 2bdf4955c8
commit 2c3593b51e

@ -1409,7 +1409,7 @@ int ObjectRef::l_set_physics_override(lua_State *L)
{
NO_MAP_LOCK_REQUIRED;
ObjectRef *ref = checkobject(L, 1);
PlayerSAO *playersao = (PlayerSAO *) getobject(ref);
PlayerSAO *playersao = getplayersao(ref);
if (playersao == nullptr)
return 0;
@ -1449,7 +1449,7 @@ int ObjectRef::l_get_physics_override(lua_State *L)
{
NO_MAP_LOCK_REQUIRED;
ObjectRef *ref = checkobject(L, 1);
PlayerSAO *playersao = (PlayerSAO *)getobject(ref);
PlayerSAO *playersao = getplayersao(ref);
if (playersao == nullptr)
return 0;