K_FlipFromObject: ACTUALLY properly calculate flip

- Now matches P_SpawnMobjFromMobjUnscaled
- To my great annoyance, requires increment of DEMOVERSION
This commit is contained in:
toaster 2025-09-12 15:45:24 +01:00
parent 751934250c
commit d2d0174003
2 changed files with 18 additions and 5 deletions

View file

@ -177,12 +177,13 @@ demoghost *ghosts = NULL;
// - 0x000D (Ring Racers v2.3)
// Currently supported:
// - 0x000E (Ring Racers 2.4 staff ghosts part 1 - initial recordings)
// - 0x000F (Ring Racers 2.4 staff ghosts part 2 - dynslopes thinker fix)
// - 0x0010 (Ring Racers 2.4 staff ghosts part 3 - skinlimit raise. don't say we never did anythin for 'ya)
// - 0x000E -- RR 2.4 indev (staff ghosts part 1 - initial recordings)
// - 0x000F -- RR 2.4 indev (staff ghosts part 2 - dynslopes thinker fix)
// - 0x0010 -- RR 2.4 rc1 (staff ghosts part 3 - skinlimit raise. don't say we never did anythin for 'ya)
// - 0x0011 -- RR 2.4 rc2 (K_FlipFromObject oversight)
#define MINDEMOVERSION 0x000E
#define DEMOVERSION 0x0010
#define DEMOVERSION 0x0011
boolean G_CompatLevel(UINT16 level)
{

View file

@ -1869,7 +1869,19 @@ void K_FlipFromObject(mobj_t *mo, mobj_t *master)
mo->flags2 = (mo->flags2 & ~MF2_OBJECTFLIP)|(master->flags2 & MF2_OBJECTFLIP);
if (mo->eflags & MFE_VERTICALFLIP)
{
if (!G_CompatLevel(0x0010))
{
mo->z = master->z + master->height // offset based off new foot position
- (mo->z - master->z) // the offset between us and master
- mo->height; // and then move our feet
}
else
{
// GOD DAMN IT, this has been wrong for years and we only notice now
mo->z += master->height - FixedMul(master->scale, mo->height);
}
}
}
void K_MatchGenericExtraFlags(mobj_t *mo, mobj_t *master)