- 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:
Christoph Oelckers 2009-05-23 10:21:33 +00:00
parent e61b4b3c76
commit 273758344f
11 changed files with 49 additions and 59 deletions

View file

@ -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. - Fixed: A_CountdownArg and A_Die must ensure a certain kill.
May 22, 2009 May 22, 2009

View file

@ -490,7 +490,7 @@ int P_GetFriction (const AActor *mo, int *frictionfactor)
} }
if ((secfriction(sec) < friction || friction == ORIG_FRICTION) && if ((secfriction(sec) < friction || friction == ORIG_FRICTION) &&
(mo->z <= sec->floorplane.ZatPoint (mo->x, mo->y) || (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)))) mo->z <= sec->heightsec->floorplane.ZatPoint (mo->x, mo->y))))
{ {
friction = secfriction (sec); friction = secfriction (sec);

View file

@ -2971,20 +2971,20 @@ void AActor::Tick ()
{ {
continue; continue;
} }
if (flags & MF_NOGRAVITY && sector_t *heightsec = sec->GetHeightSec();
(sec->heightsec == NULL || (sec->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC))) if (flags & MF_NOGRAVITY && heightsec == NULL)
{ {
continue; continue;
} }
height = sec->floorplane.ZatPoint (x, y); height = sec->floorplane.ZatPoint (x, y);
if (z > height) if (z > height)
{ {
if (sec->heightsec == NULL || (sec->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC)) if (heightsec == NULL)
{ {
continue; continue;
} }
waterheight = sec->heightsec->floorplane.ZatPoint (x, y); waterheight = heightsec->floorplane.ZatPoint (x, y);
if (waterheight > height && z >= waterheight) if (waterheight > height && z >= waterheight)
{ {
continue; continue;
@ -3232,8 +3232,8 @@ bool AActor::UpdateWaterLevel (fixed_t oldz, bool dosplash)
} }
else else
{ {
const sector_t *hsec = Sector->heightsec; const sector_t *hsec = Sector->GetHeightSec();
if (hsec != NULL && !(hsec->MoreFlags & SECF_IGNOREHEIGHTSEC)) if (hsec != NULL)
{ {
fh = hsec->floorplane.ZatPoint (x, y); fh = hsec->floorplane.ZatPoint (x, y);
//if (hsec->MoreFlags & SECF_UNDERWATERMASK) // also check Boom-style non-swimmable sectors //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. // do the floorclipping instead of the terrain type.
for (m = touching_sectorlist; m; m = m->m_tnext) for (m = touching_sectorlist; m; m = m->m_tnext)
{ {
if ((m->m_sector->heightsec == NULL || sector_t *hsec = m->m_sector->GetHeightSec();
m->m_sector->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC) && if (hsec == NULL && m->m_sector->floorplane.ZatPoint (x, y) == z)
m->m_sector->floorplane.ZatPoint (x, y) == z)
{ {
fixed_t clip = Terrains[TerrainTypes[m->m_sector->GetTexture(sector_t::floor)]].FootClip; fixed_t clip = Terrains[TerrainTypes[m->m_sector->GetTexture(sector_t::floor)]].FootClip;
if (clip < shallowestclip) 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; if (planez < z) return false;
} }
#endif #endif
if (sec->heightsec == NULL || sector_t *hsec = sec->GetHeightSec();
//!sec->heightsec->waterzone || if (hsec == NULL || !(hsec->MoreFlags & SECF_CLIPFAKEPLANES))
(sec->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC) ||
!(sec->heightsec->MoreFlags & SECF_CLIPFAKEPLANES))
{ {
terrainnum = TerrainTypes[sec->GetTexture(sector_t::floor)]; terrainnum = TerrainTypes[sec->GetTexture(sector_t::floor)];
} }
else else
{ {
terrainnum = TerrainTypes[sec->heightsec->GetTexture(sector_t::floor)]; terrainnum = TerrainTypes[hsec->GetTexture(sector_t::floor)];
} }
#ifdef _3DFLOORS #ifdef _3DFLOORS
foundone: foundone:
@ -4542,10 +4539,7 @@ foundone:
// don't splash when touching an underwater floor // don't splash when touching an underwater floor
if (thing->waterlevel>=1 && z<=thing->floorz) return Terrains[terrainnum].IsLiquid; if (thing->waterlevel>=1 && z<=thing->floorz) return Terrains[terrainnum].IsLiquid;
plane = (sec->heightsec != NULL && plane = hsec != NULL? &sec->heightsec->floorplane : &sec->floorplane;
//sec->heightsec->waterzone &&
!(sec->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC))
? &sec->heightsec->floorplane : &sec->floorplane;
// Don't splash for living things with small vertical velocities. // Don't splash for living things with small vertical velocities.
// There are levels where the constant splashing from the monsters gets extremely annoying // There are levels where the constant splashing from the monsters gets extremely annoying
@ -4642,9 +4636,7 @@ bool P_HitFloor (AActor *thing)
} }
#endif #endif
} }
if (m == NULL || if (m == NULL || m->m_sector->GetHeightSec() != NULL)
(m->m_sector->heightsec != NULL &&
!(m->m_sector->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC)))
{ {
return false; return false;
} }

View file

@ -681,13 +681,13 @@ sightcounts[0]++;
// killough 4/19/98: make fake floors and ceilings block monster view // 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) && ((t1->z + t1->height <= s1->heightsec->floorplane.ZatPoint (t1->x, t1->y) &&
t2->z >= s1->heightsec->floorplane.ZatPoint (t2->x, t2->y)) || t2->z >= s1->heightsec->floorplane.ZatPoint (t2->x, t2->y)) ||
(t1->z >= s1->heightsec->ceilingplane.ZatPoint (t1->x, t1->y) && (t1->z >= s1->heightsec->ceilingplane.ZatPoint (t1->x, t1->y) &&
t2->z + t1->height <= s1->heightsec->ceilingplane.ZatPoint (t2->x, t2->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) && ((t2->z + t2->height <= s2->heightsec->floorplane.ZatPoint (t2->x, t2->y) &&
t1->z >= s2->heightsec->floorplane.ZatPoint (t1->x, t1->y)) || t1->z >= s2->heightsec->floorplane.ZatPoint (t1->x, t1->y)) ||
(t2->z >= s2->heightsec->ceilingplane.ZatPoint (t2->x, t2->y) && (t2->z >= s2->heightsec->ceilingplane.ZatPoint (t2->x, t2->y) &&

View file

@ -636,17 +636,17 @@ CUSTOM_CVAR (Bool, forcewater, false, CVAR_ARCHIVE|CVAR_SERVERINFO)
for (i = 0; i < numsectors; i++) for (i = 0; i < numsectors; i++)
{ {
if (sectors[i].heightsec && sector_t *hsec = sectors[i].GetHeightSec();
!(sectors[i].heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC) && if (hsec &&
!(sectors[i].heightsec->MoreFlags & SECF_UNDERWATER)) !(sectors[i].heightsec->MoreFlags & SECF_UNDERWATER))
{ {
if (self) if (self)
{ {
sectors[i].heightsec->MoreFlags |= SECF_FORCEDUNDERWATER; hsec->MoreFlags |= SECF_FORCEDUNDERWATER;
} }
else else
{ {
sectors[i].heightsec->MoreFlags &= ~SECF_FORCEDUNDERWATER; hsec->MoreFlags &= ~SECF_FORCEDUNDERWATER;
} }
} }
} }
@ -1010,6 +1010,7 @@ void P_SpawnSpecials (void)
{ {
sectors[s].heightsec = sec; sectors[s].heightsec = sec;
sec->e->FakeFloor.Sectors.Push(&sectors[s]); sec->e->FakeFloor.Sectors.Push(&sectors[s]);
sectors[s].AdjustFloorClip();
} }
break; break;
@ -1747,10 +1748,11 @@ void DPusher::Tick ()
thing = node->m_thing; thing = node->m_thing;
if (!(thing->flags2 & MF2_WINDTHRUST) || (thing->flags & MF_NOCLIP)) if (!(thing->flags2 & MF2_WINDTHRUST) || (thing->flags & MF_NOCLIP))
continue; continue;
sector_t *hsec = sec->GetHeightSec();
if (m_Type == p_wind) if (m_Type == p_wind)
{ {
if (sec->heightsec == NULL || if (hsec == NULL)
sec->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC)
{ // NOT special water sector { // NOT special water sector
if (thing->z > thing->floorz) // above ground if (thing->z > thing->floorz) // above ground
{ {
@ -1765,7 +1767,7 @@ void DPusher::Tick ()
} }
else // special water sector 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 if (thing->z > ht) // above ground
{ {
xspeed = m_Xmag; // full force xspeed = m_Xmag; // full force
@ -1786,14 +1788,13 @@ void DPusher::Tick ()
{ {
const secplane_t *floor; const secplane_t *floor;
if (sec->heightsec == NULL || if (hsec == NULL)
(sec->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC))
{ // NOT special water sector { // NOT special water sector
floor = &sec->floorplane; floor = &sec->floorplane;
} }
else else
{ // special water sector { // special water sector
floor = &sec->heightsec->floorplane; floor = &hsec->floorplane;
} }
if (thing->z > floor->ZatPoint (thing->x, thing->y)) if (thing->z > floor->ZatPoint (thing->x, thing->y))
{ // above ground { // above ground

View file

@ -312,11 +312,11 @@ bool FTraceInfo::TraceTraverse (int ptflags)
bc = entersector->ceilingplane.ZatPoint (hitx, hity); bc = entersector->ceilingplane.ZatPoint (hitx, hity);
} }
sector_t *hsec = CurSector->GetHeightSec();
if (Results->CrossedWater == NULL && if (Results->CrossedWater == NULL &&
CurSector->heightsec && hsec != NULL &&
!(CurSector->MoreFlags & SECF_IGNOREHEIGHTSEC) &&
//CurSector->heightsec->waterzone && //CurSector->heightsec->waterzone &&
hitz <= CurSector->heightsec->floorplane.ZatPoint (hitx, hity)) hitz <= hsec->floorplane.ZatPoint (hitx, hity))
{ {
// hit crossed a water plane // hit crossed a water plane
Results->CrossedWater = &sectors[CurSector->sectornum]; Results->CrossedWater = &sectors[CurSector->sectornum];

View file

@ -352,9 +352,9 @@ sector_t *R_FakeFlat(sector_t *sec, sector_t *tempsec,
FakeSide = FAKED_Center; 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; sector_t *heightsec = viewsector->heightsec;
bool underwater = r_fakingunderwater || bool underwater = r_fakingunderwater ||
(heightsec && viewz <= heightsec->floorplane.ZatPoint (viewx, viewy)); (heightsec && viewz <= heightsec->floorplane.ZatPoint (viewx, viewy));

View file

@ -585,6 +585,11 @@ struct sector_t
planes[pos].TexZ += val; planes[pos].TexZ += val;
} }
sector_t *GetHeightSec() const
{
return (MoreFlags & SECF_IGNOREHEIGHTSEC)? NULL : heightsec;
}
// Member variables // Member variables
fixed_t CenterFloor () const { return floorplane.ZatPoint (soundorg[0], soundorg[1]); } fixed_t CenterFloor () const { return floorplane.ZatPoint (soundorg[0], soundorg[1]); }

View file

@ -1108,10 +1108,9 @@ void R_SetupFrame (AActor *actor)
// killough 3/20/98, 4/4/98: select colormap based on player status // killough 3/20/98, 4/4/98: select colormap based on player status
// [RH] Can also select a blend // [RH] Can also select a blend
if (viewsector->heightsec && const sector_t *s = viewsector->GetHeightSec();
!(viewsector->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC)) if (s != NULL)
{ {
const sector_t *s = viewsector->heightsec;
newblend = viewz < s->floorplane.ZatPoint (viewx, viewy) newblend = viewz < s->floorplane.ZatPoint (viewx, viewy)
? s->bottommap ? s->bottommap
: viewz > s->ceilingplane.ZatPoint (viewx, viewy) : viewz > s->ceilingplane.ZatPoint (viewx, viewy)

View file

@ -1391,8 +1391,7 @@ void R_NewWall (bool needlights)
// it is definitely invisible and doesn't need to be marked. // it is definitely invisible and doesn't need to be marked.
// killough 3/7/98: add deep water check // killough 3/7/98: add deep water check
if (frontsector->heightsec == NULL || if (frontsector->GetHeightSec() == NULL)
(frontsector->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC))
{ {
if (frontsector->floorplane.ZatPoint (viewx, viewy) >= viewz) // above view plane if (frontsector->floorplane.ZatPoint (viewx, viewy) >= viewz) // above view plane
markfloor = false; markfloor = false;

View file

@ -1347,14 +1347,9 @@ void R_ProjectSprite (AActor *thing, int fakeside)
// from the viewer, by either water or fake ceilings // from the viewer, by either water or fake ceilings
// killough 4/11/98: improve sprite clipping for underwater/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) if (heightsec != NULL) // only clip things which are in special sectors
{
heightsec = NULL;
}
if (heightsec) // only clip things which are in special sectors
{ {
if (fakeside == FAKED_AboveCeiling) if (fakeside == FAKED_AboveCeiling)
{ {
@ -2356,12 +2351,7 @@ void R_ProjectParticle (particle_t *particle, const sector_t *sector, int shade,
return; return;
// Clip particles above the ceiling or below the floor. // Clip particles above the ceiling or below the floor.
heightsec = sector->heightsec; heightsec = sector->GetHeightSec();
if (heightsec != NULL && heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC)
{
heightsec = NULL;
}
const secplane_t *topplane; const secplane_t *topplane;
const secplane_t *botplane; const secplane_t *botplane;