mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 14:51:40 +00:00
- Fixed: When setting up a deep water sector with Transfer_Heights the floorclip
information of all actors in the sector needs to be updated. SVN r1600 (trunk)
This commit is contained in:
parent
e61b4b3c76
commit
273758344f
11 changed files with 49 additions and 59 deletions
|
@ -1,4 +1,8 @@
|
|||
May 22, 2009 (Changes by Graf Zahl)
|
||||
May 23, 2009 (Changes by Graf Zahl)
|
||||
- Fixed: When setting up a deep water sector with Transfer_Heights the floorclip
|
||||
information of all actors in the sector needs to be updated.
|
||||
|
||||
May 22, 2009 (Changes by Graf Zahl)
|
||||
- Fixed: A_CountdownArg and A_Die must ensure a certain kill.
|
||||
|
||||
May 22, 2009
|
||||
|
|
|
@ -490,7 +490,7 @@ int P_GetFriction (const AActor *mo, int *frictionfactor)
|
|||
}
|
||||
if ((secfriction(sec) < friction || friction == ORIG_FRICTION) &&
|
||||
(mo->z <= sec->floorplane.ZatPoint (mo->x, mo->y) ||
|
||||
(sec->heightsec && !(sec->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC) &&
|
||||
(sec->GetHeightSec() != NULL &&
|
||||
mo->z <= sec->heightsec->floorplane.ZatPoint (mo->x, mo->y))))
|
||||
{
|
||||
friction = secfriction (sec);
|
||||
|
|
|
@ -2971,20 +2971,20 @@ void AActor::Tick ()
|
|||
{
|
||||
continue;
|
||||
}
|
||||
if (flags & MF_NOGRAVITY &&
|
||||
(sec->heightsec == NULL || (sec->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC)))
|
||||
sector_t *heightsec = sec->GetHeightSec();
|
||||
if (flags & MF_NOGRAVITY && heightsec == NULL)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
height = sec->floorplane.ZatPoint (x, y);
|
||||
if (z > height)
|
||||
{
|
||||
if (sec->heightsec == NULL || (sec->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC))
|
||||
if (heightsec == NULL)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
waterheight = sec->heightsec->floorplane.ZatPoint (x, y);
|
||||
waterheight = heightsec->floorplane.ZatPoint (x, y);
|
||||
if (waterheight > height && z >= waterheight)
|
||||
{
|
||||
continue;
|
||||
|
@ -3232,8 +3232,8 @@ bool AActor::UpdateWaterLevel (fixed_t oldz, bool dosplash)
|
|||
}
|
||||
else
|
||||
{
|
||||
const sector_t *hsec = Sector->heightsec;
|
||||
if (hsec != NULL && !(hsec->MoreFlags & SECF_IGNOREHEIGHTSEC))
|
||||
const sector_t *hsec = Sector->GetHeightSec();
|
||||
if (hsec != NULL)
|
||||
{
|
||||
fh = hsec->floorplane.ZatPoint (x, y);
|
||||
//if (hsec->MoreFlags & SECF_UNDERWATERMASK) // also check Boom-style non-swimmable sectors
|
||||
|
@ -3648,9 +3648,8 @@ void AActor::AdjustFloorClip ()
|
|||
// do the floorclipping instead of the terrain type.
|
||||
for (m = touching_sectorlist; m; m = m->m_tnext)
|
||||
{
|
||||
if ((m->m_sector->heightsec == NULL ||
|
||||
m->m_sector->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC) &&
|
||||
m->m_sector->floorplane.ZatPoint (x, y) == z)
|
||||
sector_t *hsec = m->m_sector->GetHeightSec();
|
||||
if (hsec == NULL && m->m_sector->floorplane.ZatPoint (x, y) == z)
|
||||
{
|
||||
fixed_t clip = Terrains[TerrainTypes[m->m_sector->GetTexture(sector_t::floor)]].FootClip;
|
||||
if (clip < shallowestclip)
|
||||
|
@ -4517,16 +4516,14 @@ bool P_HitWater (AActor * thing, sector_t * sec, fixed_t x, fixed_t y, fixed_t z
|
|||
if (planez < z) return false;
|
||||
}
|
||||
#endif
|
||||
if (sec->heightsec == NULL ||
|
||||
//!sec->heightsec->waterzone ||
|
||||
(sec->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC) ||
|
||||
!(sec->heightsec->MoreFlags & SECF_CLIPFAKEPLANES))
|
||||
sector_t *hsec = sec->GetHeightSec();
|
||||
if (hsec == NULL || !(hsec->MoreFlags & SECF_CLIPFAKEPLANES))
|
||||
{
|
||||
terrainnum = TerrainTypes[sec->GetTexture(sector_t::floor)];
|
||||
}
|
||||
else
|
||||
{
|
||||
terrainnum = TerrainTypes[sec->heightsec->GetTexture(sector_t::floor)];
|
||||
terrainnum = TerrainTypes[hsec->GetTexture(sector_t::floor)];
|
||||
}
|
||||
#ifdef _3DFLOORS
|
||||
foundone:
|
||||
|
@ -4542,10 +4539,7 @@ foundone:
|
|||
// don't splash when touching an underwater floor
|
||||
if (thing->waterlevel>=1 && z<=thing->floorz) return Terrains[terrainnum].IsLiquid;
|
||||
|
||||
plane = (sec->heightsec != NULL &&
|
||||
//sec->heightsec->waterzone &&
|
||||
!(sec->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC))
|
||||
? &sec->heightsec->floorplane : &sec->floorplane;
|
||||
plane = hsec != NULL? &sec->heightsec->floorplane : &sec->floorplane;
|
||||
|
||||
// Don't splash for living things with small vertical velocities.
|
||||
// There are levels where the constant splashing from the monsters gets extremely annoying
|
||||
|
@ -4642,9 +4636,7 @@ bool P_HitFloor (AActor *thing)
|
|||
}
|
||||
#endif
|
||||
}
|
||||
if (m == NULL ||
|
||||
(m->m_sector->heightsec != NULL &&
|
||||
!(m->m_sector->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC)))
|
||||
if (m == NULL || m->m_sector->GetHeightSec() != NULL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -681,13 +681,13 @@ sightcounts[0]++;
|
|||
|
||||
// killough 4/19/98: make fake floors and ceilings block monster view
|
||||
|
||||
if ((s1->heightsec && !(s1->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC) &&
|
||||
if ((s1->GetHeightSec() &&
|
||||
((t1->z + t1->height <= s1->heightsec->floorplane.ZatPoint (t1->x, t1->y) &&
|
||||
t2->z >= s1->heightsec->floorplane.ZatPoint (t2->x, t2->y)) ||
|
||||
(t1->z >= s1->heightsec->ceilingplane.ZatPoint (t1->x, t1->y) &&
|
||||
t2->z + t1->height <= s1->heightsec->ceilingplane.ZatPoint (t2->x, t2->y))))
|
||||
||
|
||||
(s2->heightsec && !(s2->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC) &&
|
||||
(s2->GetHeightSec() &&
|
||||
((t2->z + t2->height <= s2->heightsec->floorplane.ZatPoint (t2->x, t2->y) &&
|
||||
t1->z >= s2->heightsec->floorplane.ZatPoint (t1->x, t1->y)) ||
|
||||
(t2->z >= s2->heightsec->ceilingplane.ZatPoint (t2->x, t2->y) &&
|
||||
|
|
|
@ -636,17 +636,17 @@ CUSTOM_CVAR (Bool, forcewater, false, CVAR_ARCHIVE|CVAR_SERVERINFO)
|
|||
|
||||
for (i = 0; i < numsectors; i++)
|
||||
{
|
||||
if (sectors[i].heightsec &&
|
||||
!(sectors[i].heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC) &&
|
||||
sector_t *hsec = sectors[i].GetHeightSec();
|
||||
if (hsec &&
|
||||
!(sectors[i].heightsec->MoreFlags & SECF_UNDERWATER))
|
||||
{
|
||||
if (self)
|
||||
{
|
||||
sectors[i].heightsec->MoreFlags |= SECF_FORCEDUNDERWATER;
|
||||
hsec->MoreFlags |= SECF_FORCEDUNDERWATER;
|
||||
}
|
||||
else
|
||||
{
|
||||
sectors[i].heightsec->MoreFlags &= ~SECF_FORCEDUNDERWATER;
|
||||
hsec->MoreFlags &= ~SECF_FORCEDUNDERWATER;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1010,6 +1010,7 @@ void P_SpawnSpecials (void)
|
|||
{
|
||||
sectors[s].heightsec = sec;
|
||||
sec->e->FakeFloor.Sectors.Push(§ors[s]);
|
||||
sectors[s].AdjustFloorClip();
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1747,10 +1748,11 @@ void DPusher::Tick ()
|
|||
thing = node->m_thing;
|
||||
if (!(thing->flags2 & MF2_WINDTHRUST) || (thing->flags & MF_NOCLIP))
|
||||
continue;
|
||||
|
||||
sector_t *hsec = sec->GetHeightSec();
|
||||
if (m_Type == p_wind)
|
||||
{
|
||||
if (sec->heightsec == NULL ||
|
||||
sec->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC)
|
||||
if (hsec == NULL)
|
||||
{ // NOT special water sector
|
||||
if (thing->z > thing->floorz) // above ground
|
||||
{
|
||||
|
@ -1765,7 +1767,7 @@ void DPusher::Tick ()
|
|||
}
|
||||
else // special water sector
|
||||
{
|
||||
ht = sec->heightsec->floorplane.ZatPoint (thing->x, thing->y);
|
||||
ht = hsec->floorplane.ZatPoint (thing->x, thing->y);
|
||||
if (thing->z > ht) // above ground
|
||||
{
|
||||
xspeed = m_Xmag; // full force
|
||||
|
@ -1786,14 +1788,13 @@ void DPusher::Tick ()
|
|||
{
|
||||
const secplane_t *floor;
|
||||
|
||||
if (sec->heightsec == NULL ||
|
||||
(sec->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC))
|
||||
if (hsec == NULL)
|
||||
{ // NOT special water sector
|
||||
floor = &sec->floorplane;
|
||||
}
|
||||
else
|
||||
{ // special water sector
|
||||
floor = &sec->heightsec->floorplane;
|
||||
floor = &hsec->floorplane;
|
||||
}
|
||||
if (thing->z > floor->ZatPoint (thing->x, thing->y))
|
||||
{ // above ground
|
||||
|
|
|
@ -312,11 +312,11 @@ bool FTraceInfo::TraceTraverse (int ptflags)
|
|||
bc = entersector->ceilingplane.ZatPoint (hitx, hity);
|
||||
}
|
||||
|
||||
sector_t *hsec = CurSector->GetHeightSec();
|
||||
if (Results->CrossedWater == NULL &&
|
||||
CurSector->heightsec &&
|
||||
!(CurSector->MoreFlags & SECF_IGNOREHEIGHTSEC) &&
|
||||
hsec != NULL &&
|
||||
//CurSector->heightsec->waterzone &&
|
||||
hitz <= CurSector->heightsec->floorplane.ZatPoint (hitx, hity))
|
||||
hitz <= hsec->floorplane.ZatPoint (hitx, hity))
|
||||
{
|
||||
// hit crossed a water plane
|
||||
Results->CrossedWater = §ors[CurSector->sectornum];
|
||||
|
|
|
@ -352,9 +352,9 @@ sector_t *R_FakeFlat(sector_t *sec, sector_t *tempsec,
|
|||
|
||||
FakeSide = FAKED_Center;
|
||||
|
||||
if (sec->heightsec && !(sec->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC))
|
||||
const sector_t *s = sec->GetHeightSec();
|
||||
if (s != NULL)
|
||||
{
|
||||
const sector_t *s = sec->heightsec;
|
||||
sector_t *heightsec = viewsector->heightsec;
|
||||
bool underwater = r_fakingunderwater ||
|
||||
(heightsec && viewz <= heightsec->floorplane.ZatPoint (viewx, viewy));
|
||||
|
|
|
@ -585,6 +585,11 @@ struct sector_t
|
|||
planes[pos].TexZ += val;
|
||||
}
|
||||
|
||||
sector_t *GetHeightSec() const
|
||||
{
|
||||
return (MoreFlags & SECF_IGNOREHEIGHTSEC)? NULL : heightsec;
|
||||
}
|
||||
|
||||
|
||||
// Member variables
|
||||
fixed_t CenterFloor () const { return floorplane.ZatPoint (soundorg[0], soundorg[1]); }
|
||||
|
|
|
@ -1108,10 +1108,9 @@ void R_SetupFrame (AActor *actor)
|
|||
// killough 3/20/98, 4/4/98: select colormap based on player status
|
||||
// [RH] Can also select a blend
|
||||
|
||||
if (viewsector->heightsec &&
|
||||
!(viewsector->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC))
|
||||
const sector_t *s = viewsector->GetHeightSec();
|
||||
if (s != NULL)
|
||||
{
|
||||
const sector_t *s = viewsector->heightsec;
|
||||
newblend = viewz < s->floorplane.ZatPoint (viewx, viewy)
|
||||
? s->bottommap
|
||||
: viewz > s->ceilingplane.ZatPoint (viewx, viewy)
|
||||
|
|
|
@ -1391,8 +1391,7 @@ void R_NewWall (bool needlights)
|
|||
// it is definitely invisible and doesn't need to be marked.
|
||||
|
||||
// killough 3/7/98: add deep water check
|
||||
if (frontsector->heightsec == NULL ||
|
||||
(frontsector->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC))
|
||||
if (frontsector->GetHeightSec() == NULL)
|
||||
{
|
||||
if (frontsector->floorplane.ZatPoint (viewx, viewy) >= viewz) // above view plane
|
||||
markfloor = false;
|
||||
|
|
|
@ -1347,14 +1347,9 @@ void R_ProjectSprite (AActor *thing, int fakeside)
|
|||
// from the viewer, by either water or fake ceilings
|
||||
// killough 4/11/98: improve sprite clipping for underwater/fake ceilings
|
||||
|
||||
heightsec = thing->Sector->heightsec;
|
||||
heightsec = thing->Sector->GetHeightSec();
|
||||
|
||||
if (heightsec != NULL && heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC)
|
||||
{
|
||||
heightsec = NULL;
|
||||
}
|
||||
|
||||
if (heightsec) // only clip things which are in special sectors
|
||||
if (heightsec != NULL) // only clip things which are in special sectors
|
||||
{
|
||||
if (fakeside == FAKED_AboveCeiling)
|
||||
{
|
||||
|
@ -2356,12 +2351,7 @@ void R_ProjectParticle (particle_t *particle, const sector_t *sector, int shade,
|
|||
return;
|
||||
|
||||
// Clip particles above the ceiling or below the floor.
|
||||
heightsec = sector->heightsec;
|
||||
|
||||
if (heightsec != NULL && heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC)
|
||||
{
|
||||
heightsec = NULL;
|
||||
}
|
||||
heightsec = sector->GetHeightSec();
|
||||
|
||||
const secplane_t *topplane;
|
||||
const secplane_t *botplane;
|
||||
|
|
Loading…
Reference in a new issue