Improved "respawn where died" functionality (#2831)
Now uses a "last safe position" system instead. This: -Prevents players from slipping into places they shouldn't via their dead body and then respawning there -No longer sends players back to spawn if they fall into kill pits -Adds a safety feature where the kill command always resets back to spawn should a player ever get stuck somewhere
This commit is contained in:
parent
9b62379645
commit
941f9502e9
6 changed files with 44 additions and 11 deletions
|
|
@ -129,6 +129,28 @@ DEFINE_ACTION_FUNCTION_NATIVE(_Sector, NextSpecialSector, P_NextSpecialSector)
|
|||
ACTION_RETURN_POINTER(P_NextSpecialSector(self, type, nogood));
|
||||
}
|
||||
|
||||
bool sector_t::IsDangerous(const DVector3& pos, double height) const
|
||||
{
|
||||
if (damageamount > 0)
|
||||
return true;
|
||||
|
||||
auto cl = dyn_cast<DCeiling>(ceilingdata.Get());
|
||||
if (cl != nullptr && cl->getCrush() > 0)
|
||||
return true;
|
||||
|
||||
for (auto rover : e->XFloor.ffloors)
|
||||
{
|
||||
if ((rover->flags & FF_EXISTS) && rover->model->damageamount > 0
|
||||
&& pos.Z <= rover->top.plane->ZatPoint(pos)
|
||||
&& pos.Z + height >= rover->bottom.plane->ZatPoint(pos))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// P_FindLowestFloorSurrounding()
|
||||
// FIND LOWEST FLOOR HEIGHT IN SURROUNDING SECTORS
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue