- SW: Don't back up the actor's Z after changing it in KeepActorOnFloor().

* This seems completely wrong and kills Z interpolation on slopes, vators, etc.
* Thanks Graf 😁
* Fixes #844.
* Partially addresses #845.
This commit is contained in:
Mitchell Richters 2023-01-08 22:12:50 +11:00
parent 1e3a285534
commit 1f489d5dbe

View file

@ -549,7 +549,6 @@ void KeepActorOnFloor(DSWActor* actor)
actor->user.Flags &= ~(SPR_SWIMMING); actor->user.Flags &= ~(SPR_SWIMMING);
actor->spr.cstat &= ~(CSTAT_SPRITE_YCENTER); actor->spr.cstat &= ~(CSTAT_SPRITE_YCENTER);
actor->spr.pos.Z = actor->user.oz = actor->user.loz; actor->spr.pos.Z = actor->user.oz = actor->user.loz;
actor->backupz();
return; return;
} }
@ -560,7 +559,6 @@ void KeepActorOnFloor(DSWActor* actor)
// are swimming // are swimming
actor->spr.pos.Z = actor->user.oz = actor->user.loz - depth; actor->spr.pos.Z = actor->user.oz = actor->user.loz - depth;
actor->backupz();
} }
else else
{ {
@ -569,7 +567,6 @@ void KeepActorOnFloor(DSWActor* actor)
{ {
NewStateGroup(actor, actor->user.ActorActionSet->Swim); NewStateGroup(actor, actor->user.ActorActionSet->Swim);
actor->spr.pos.Z = actor->user.oz = actor->user.loz - depth; actor->spr.pos.Z = actor->user.oz = actor->user.loz - depth;
actor->backupz();
actor->user.Flags |= (SPR_SWIMMING); actor->user.Flags |= (SPR_SWIMMING);
actor->spr.cstat |= (CSTAT_SPRITE_YCENTER); actor->spr.cstat |= (CSTAT_SPRITE_YCENTER);
} }
@ -578,7 +575,6 @@ void KeepActorOnFloor(DSWActor* actor)
actor->user.Flags &= ~(SPR_SWIMMING); actor->user.Flags &= ~(SPR_SWIMMING);
actor->spr.cstat &= ~(CSTAT_SPRITE_YCENTER); actor->spr.cstat &= ~(CSTAT_SPRITE_YCENTER);
actor->spr.pos.Z = actor->user.oz = actor->user.loz; actor->spr.pos.Z = actor->user.oz = actor->user.loz;
actor->backupz();
} }
} }
@ -593,7 +589,6 @@ void KeepActorOnFloor(DSWActor* actor)
if (actor->user.Flags & (SPR_MOVED)) if (actor->user.Flags & (SPR_MOVED))
{ {
actor->spr.pos.Z = actor->user.oz = actor->user.loz; actor->spr.pos.Z = actor->user.oz = actor->user.loz;
actor->backupz();
} }
else else
{ {
@ -602,7 +597,6 @@ void KeepActorOnFloor(DSWActor* actor)
FAFgetzrangepoint(actor->spr.pos, actor->sector(),&ceilz, &ctrash, &florz, &ftrash); FAFgetzrangepoint(actor->spr.pos, actor->sector(),&ceilz, &ctrash, &florz, &ftrash);
actor->spr.pos.Z = actor->user.oz = florz; actor->spr.pos.Z = actor->user.oz = florz;
actor->backupz();
} }
#endif #endif
} }