Fix broken scripts that rely on P_GetMobjGravity without gravity
This commit is contained in:
parent
78fc3ef964
commit
fcb20bbdd4
1 changed files with 6 additions and 0 deletions
|
|
@ -891,7 +891,13 @@ static int lib_pGetMobjGravity(lua_State *L)
|
|||
INLEVEL
|
||||
if (!mobj)
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
|
||||
// HACK: reset the gravity of the object to remain compatible with addons
|
||||
// that lack a MF_NOGRAVITY check around the call.
|
||||
fixed_t grav = mobj->gravity;
|
||||
mobj->gravity = FRACUNIT;
|
||||
lua_pushfixed(L, P_GetMobjGravity(mobj));
|
||||
mobj->gravity = grav;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue