- floatified some stuff in g_shared.
Note: This commit does not handle z-spawn positions correctly.
This commit is contained in:
parent
301f5abadc
commit
2a0d5a621a
7 changed files with 79 additions and 105 deletions
|
|
@ -413,20 +413,17 @@ DEFINE_ACTION_FUNCTION(AActor, A_RestoreSpecialPosition)
|
|||
PARAM_ACTION_PROLOGUE;
|
||||
|
||||
// Move item back to its original location
|
||||
fixed_t _x, _y;
|
||||
|
||||
_x = self->SpawnPoint[0];
|
||||
_y = self->SpawnPoint[1];
|
||||
DVector2 sp = self->SpawnPoint;
|
||||
|
||||
self->UnlinkFromWorld();
|
||||
self->SetXY(_x, _y);
|
||||
self->SetXY(sp);
|
||||
self->LinkToWorld(true);
|
||||
self->_f_SetZ(self->Sector->floorplane.ZatPoint(_x, _y));
|
||||
self->SetZ(self->Sector->floorplane.ZatPoint(sp));
|
||||
P_FindFloorCeiling(self, FFCF_ONLYSPAWNPOS | FFCF_NOPORTALS); // no portal checks here so that things get spawned in this sector.
|
||||
|
||||
if (self->flags & MF_SPAWNCEILING)
|
||||
{
|
||||
self->_f_SetZ(self->_f_ceilingz() - self->_f_height() - self->SpawnPoint[2]);
|
||||
self->SetZ(self->ceilingz - self->Height - self->SpawnPoint.Z);
|
||||
}
|
||||
else if (self->flags2 & MF2_SPAWNFLOAT)
|
||||
{
|
||||
|
|
@ -443,7 +440,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_RestoreSpecialPosition)
|
|||
}
|
||||
else
|
||||
{
|
||||
self->_f_SetZ(self->SpawnPoint[2] + self->_f_floorz());
|
||||
self->SetZ(self->SpawnPoint.Z + self->floorz);
|
||||
}
|
||||
// Redo floor/ceiling check, in case of 3D floors and portals
|
||||
P_FindFloorCeiling(self, FFCF_SAMESECTOR | FFCF_ONLY3DFLOORS | FFCF_3DRESTRICT);
|
||||
|
|
@ -1354,7 +1351,7 @@ bool AInventory::DoRespawn ()
|
|||
if (spot != NULL)
|
||||
{
|
||||
SetOrigin (spot->Pos(), false);
|
||||
_f_SetZ(_f_floorz());
|
||||
SetZ(floorz);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue