Skip to content

Commit

Permalink
Fix unsafe cast in l_object
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenwardy committed Dec 23, 2020
1 parent 2bdf495 commit 2c3593b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/script/lua_api/l_object.cpp
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 2c3593b

Please sign in to comment.