Skip to content

Commit 2c3593b

Browse files
committedDec 23, 2020
Fix unsafe cast in l_object
1 parent 2bdf495 commit 2c3593b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/script/lua_api/l_object.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1409,7 +1409,7 @@ int ObjectRef::l_set_physics_override(lua_State *L)
14091409
{
14101410
NO_MAP_LOCK_REQUIRED;
14111411
ObjectRef *ref = checkobject(L, 1);
1412-
PlayerSAO *playersao = (PlayerSAO *) getobject(ref);
1412+
PlayerSAO *playersao = getplayersao(ref);
14131413
if (playersao == nullptr)
14141414
return 0;
14151415

@@ -1449,7 +1449,7 @@ int ObjectRef::l_get_physics_override(lua_State *L)
14491449
{
14501450
NO_MAP_LOCK_REQUIRED;
14511451
ObjectRef *ref = checkobject(L, 1);
1452-
PlayerSAO *playersao = (PlayerSAO *)getobject(ref);
1452+
PlayerSAO *playersao = getplayersao(ref);
14531453
if (playersao == nullptr)
14541454
return 0;
14551455

0 commit comments

Comments
 (0)
Please sign in to comment.