aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2020-12-23 16:39:29 +0000
committerrubenwardy <rw@rubenwardy.com>2020-12-23 22:24:58 +0000
commit2c3593b51eef193eb543a08eb1e83c37e2fafe72 (patch)
tree57c080a8caf3c7862ef98e5f2ebc431e3455385f
parent2bdf4955c8427dd5a9ad1287344e416643b397a4 (diff)
downloadminetest-2c3593b51eef193eb543a08eb1e83c37e2fafe72.tar.gz
minetest-2c3593b51eef193eb543a08eb1e83c37e2fafe72.tar.bz2
minetest-2c3593b51eef193eb543a08eb1e83c37e2fafe72.zip
Fix unsafe cast in l_object
-rw-r--r--src/script/lua_api/l_object.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/script/lua_api/l_object.cpp b/src/script/lua_api/l_object.cpp
index bc59bd55c..4d7a1bc41 100644
--- a/src/script/lua_api/l_object.cpp
+++ b/src/script/lua_api/l_object.cpp
@@ -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;