- fixed: group teleporters must always preserve orientation.

This commit is contained in:
Christoph Oelckers 2022-04-15 22:49:23 +02:00
parent a25ba16755
commit a40b1f1934

View file

@ -662,10 +662,11 @@ bool DoGroupForOne (AActor *victim, AActor *source, AActor *dest, bool floorz, b
DAngle offAngle = victim->Angles.Yaw - source->Angles.Yaw;
DVector2 newp = { off.X * an.Cos() - off.Y * an.Sin(), off.X * an.Sin() + off.Y * an.Cos() };
double z = floorz ? ONFLOORZ : dest->Z() + victim->Z() - source->Z();
int flags = fog ? (TELF_DESTFOG | TELF_SOURCEFOG | TELF_KEEPORIENTATION) : TELF_KEEPORIENTATION;
bool res =
P_Teleport (victim, DVector3(dest->Pos().XY() + newp, z),
0., fog ? (TELF_DESTFOG | TELF_SOURCEFOG) : TELF_KEEPORIENTATION);
0., flags);
// P_Teleport only changes angle if fog is true
victim->Angles.Yaw = (dest->Angles.Yaw + victim->Angles.Yaw - source->Angles.Yaw).Normalized360();