mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-22 09:11:21 +00:00
Copy interp state in P_SpawnMobjFromMobj
This commit is contained in:
parent
1aebf41e82
commit
5d4f7f2ad2
1 changed files with 24 additions and 0 deletions
24
src/p_mobj.c
24
src/p_mobj.c
|
@ -14012,5 +14012,29 @@ mobj_t *P_SpawnMobjFromMobj(mobj_t *mobj, fixed_t xofs, fixed_t yofs, fixed_t zo
|
|||
|
||||
newmobj->destscale = mobj->destscale;
|
||||
P_SetScale(newmobj, mobj->scale);
|
||||
|
||||
newmobj->old_x2 = mobj->old_x2 + xofs;
|
||||
newmobj->old_y2 = mobj->old_y2 + yofs;
|
||||
newmobj->old_z2 = mobj->old_z2 + yofs;
|
||||
newmobj->old_x = mobj->old_x + xofs;
|
||||
newmobj->old_y = mobj->old_y + yofs;
|
||||
newmobj->old_z = mobj->old_z + yofs;
|
||||
|
||||
// This angle hack is needed for Lua scripts that set the angle after
|
||||
// spawning, to avoid erroneous interpolation.
|
||||
if (mobj->player)
|
||||
{
|
||||
newmobj->old_angle2 = mobj->player->old_drawangle2;
|
||||
newmobj->old_angle = mobj->player->old_drawangle;
|
||||
}
|
||||
else
|
||||
{
|
||||
newmobj->old_angle2 = mobj->old_angle2;
|
||||
newmobj->old_angle = mobj->old_angle;
|
||||
}
|
||||
|
||||
newmobj->old_scale2 = mobj->old_scale2;
|
||||
newmobj->old_scale = mobj->old_scale;
|
||||
|
||||
return newmobj;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue