mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-11 07:11:54 +00:00
- add savegame compatibility handling for damage related changes: When loading an old savegame the sector specials must be reinitialized to set the damage properties.
This commit is contained in:
parent
5474e01de8
commit
1ee441412a
4 changed files with 25 additions and 32 deletions
|
@ -791,7 +791,7 @@ int DPhased::PhaseHelper (sector_t *sector, int index, int light, sector_t *prev
|
|||
index + 1, l->m_BaseLevel, sector);
|
||||
l->m_Phase = ((numsteps - index - 1) * 64) / numsteps;
|
||||
|
||||
sector->special &= 0xff00;
|
||||
sector->special = 0;
|
||||
|
||||
return numsteps;
|
||||
}
|
||||
|
@ -820,7 +820,6 @@ DPhased::DPhased (sector_t *sector, int baselevel, int phase)
|
|||
{
|
||||
m_BaseLevel = baselevel;
|
||||
m_Phase = phase;
|
||||
sector->special &= 0xff00;
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
|
|
|
@ -410,19 +410,8 @@ void P_SerializeWorld (FArchive &arc)
|
|||
short secretsector;
|
||||
arc << secretsector;
|
||||
if (secretsector) sec->Flags |= SECF_WASSECRET;
|
||||
if (sec->special & SECRET_MASK)
|
||||
{
|
||||
sec->Flags |= SECF_SECRET;
|
||||
}
|
||||
if (sec->special & FRICTION_MASK)
|
||||
{
|
||||
sec->Flags |= SECF_FRICTION;
|
||||
}
|
||||
if (sec->special & PUSH_MASK)
|
||||
{
|
||||
sec->Flags |= SECF_PUSH;
|
||||
}
|
||||
sec->special &= ~(SECRET_MASK|FRICTION_MASK|PUSH_MASK);
|
||||
P_InitSectorSpecial(sec, sec->special, true);
|
||||
}
|
||||
arc << sec->interpolations[0]
|
||||
<< sec->interpolations[1]
|
||||
|
|
|
@ -1098,7 +1098,7 @@ static void P_SetupSectorDamage(sector_t *sector, int damage, int interval, int
|
|||
// ('fromload' is necessary to allow conversion upon savegame load.)
|
||||
//
|
||||
|
||||
void P_InitSectorSpecial(sector_t *sector, int special)
|
||||
void P_InitSectorSpecial(sector_t *sector, int special, bool nothinkers)
|
||||
{
|
||||
// [RH] All secret sectors are marked with a BOOM-ish bitfield
|
||||
if (sector->special & SECRET_MASK)
|
||||
|
@ -1133,28 +1133,28 @@ void P_InitSectorSpecial(sector_t *sector, int special)
|
|||
switch (sector->special)
|
||||
{
|
||||
case Light_Phased:
|
||||
new DPhased (sector, 48, 63 - (sector->lightlevel & 63));
|
||||
if (!nothinkers) new DPhased (sector, 48, 63 - (sector->lightlevel & 63));
|
||||
break;
|
||||
|
||||
// [RH] Hexen-like phased lighting
|
||||
case LightSequenceStart:
|
||||
new DPhased (sector);
|
||||
if (!nothinkers) new DPhased (sector);
|
||||
break;
|
||||
|
||||
case dLight_Flicker:
|
||||
new DLightFlash (sector);
|
||||
if (!nothinkers) new DLightFlash (sector);
|
||||
break;
|
||||
|
||||
case dLight_StrobeFast:
|
||||
new DStrobe (sector, STROBEBRIGHT, FASTDARK, false);
|
||||
if (!nothinkers) new DStrobe (sector, STROBEBRIGHT, FASTDARK, false);
|
||||
break;
|
||||
|
||||
case dLight_StrobeSlow:
|
||||
new DStrobe (sector, STROBEBRIGHT, SLOWDARK, false);
|
||||
if (!nothinkers) new DStrobe (sector, STROBEBRIGHT, SLOWDARK, false);
|
||||
break;
|
||||
|
||||
case dLight_Strobe_Hurt:
|
||||
new DStrobe (sector, STROBEBRIGHT, FASTDARK, false);
|
||||
if (!nothinkers) new DStrobe (sector, STROBEBRIGHT, FASTDARK, false);
|
||||
P_SetupSectorDamage(sector, 20, 32, 5, NAME_Slime, 0);
|
||||
break;
|
||||
|
||||
|
@ -1167,7 +1167,7 @@ void P_InitSectorSpecial(sector_t *sector, int special)
|
|||
break;
|
||||
|
||||
case dLight_Glow:
|
||||
new DGlow (sector);
|
||||
if (!nothinkers) new DGlow (sector);
|
||||
break;
|
||||
|
||||
case dSector_DoorCloseIn30:
|
||||
|
@ -1179,11 +1179,11 @@ void P_InitSectorSpecial(sector_t *sector, int special)
|
|||
break;
|
||||
|
||||
case dLight_StrobeSlowSync:
|
||||
new DStrobe (sector, STROBEBRIGHT, SLOWDARK, true);
|
||||
if (!nothinkers) new DStrobe (sector, STROBEBRIGHT, SLOWDARK, true);
|
||||
break;
|
||||
|
||||
case dLight_StrobeFastSync:
|
||||
new DStrobe (sector, STROBEBRIGHT, FASTDARK, true);
|
||||
if (!nothinkers) new DStrobe (sector, STROBEBRIGHT, FASTDARK, true);
|
||||
break;
|
||||
|
||||
case dSector_DoorRaiseIn5Mins:
|
||||
|
@ -1201,7 +1201,7 @@ void P_InitSectorSpecial(sector_t *sector, int special)
|
|||
break;
|
||||
|
||||
case dLight_FireFlicker:
|
||||
new DFireFlicker (sector);
|
||||
if (!nothinkers) new DFireFlicker (sector);
|
||||
break;
|
||||
|
||||
case dDamage_LavaWimpy:
|
||||
|
@ -1214,9 +1214,12 @@ void P_InitSectorSpecial(sector_t *sector, int special)
|
|||
|
||||
case dScroll_EastLavaDamage:
|
||||
P_SetupSectorDamage(sector, 5, 32, 256, NAME_Fire, SECF_DMGTERRAINFX);
|
||||
new DStrobe (sector, STROBEBRIGHT, FASTDARK, false);
|
||||
new DScroller (DScroller::sc_floor, (-FRACUNIT/2)<<3,
|
||||
0, -1, int(sector-sectors), 0);
|
||||
if (!nothinkers)
|
||||
{
|
||||
new DStrobe(sector, STROBEBRIGHT, FASTDARK, false);
|
||||
new DScroller(DScroller::sc_floor, (-FRACUNIT / 2) << 3,
|
||||
0, -1, int(sector - sectors), 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case hDamage_Sludge:
|
||||
|
@ -1225,7 +1228,7 @@ void P_InitSectorSpecial(sector_t *sector, int special)
|
|||
|
||||
case sLight_Strobe_Hurt:
|
||||
P_SetupSectorDamage(sector, 5, 32, 0, NAME_Slime, 0);
|
||||
new DStrobe (sector, STROBEBRIGHT, FASTDARK, false);
|
||||
if (!nothinkers) new DStrobe (sector, STROBEBRIGHT, FASTDARK, false);
|
||||
break;
|
||||
|
||||
case sDamage_Hellslime:
|
||||
|
@ -1270,16 +1273,17 @@ void P_InitSectorSpecial(sector_t *sector, int special)
|
|||
{ 1, -1 }, { 2, -2 }, { 4, -4 }
|
||||
};
|
||||
|
||||
|
||||
int i = (sector->special & 0xff) - Scroll_North_Slow;
|
||||
fixed_t dx = hexenScrollies[i][0] * (FRACUNIT/2);
|
||||
fixed_t dy = hexenScrollies[i][1] * (FRACUNIT/2);
|
||||
new DScroller (DScroller::sc_floor, dx, dy, -1, int(sector-sectors), 0);
|
||||
if (!nothinkers) new DScroller (DScroller::sc_floor, dx, dy, -1, int(sector-sectors), 0);
|
||||
}
|
||||
else if (sector->special >= Carry_East5 &&
|
||||
sector->special <= Carry_East35)
|
||||
{ // Heretic scroll special
|
||||
// Only east scrollers also scroll the texture
|
||||
new DScroller (DScroller::sc_floor,
|
||||
if (!nothinkers) new DScroller (DScroller::sc_floor,
|
||||
(-FRACUNIT/2)<<((sector->special & 0xff) - Carry_East5),
|
||||
0, -1, int(sector-sectors), 0);
|
||||
}
|
||||
|
@ -1309,7 +1313,7 @@ void P_SpawnSpecials (void)
|
|||
if (sector->special == 0)
|
||||
continue;
|
||||
|
||||
P_InitSectorSpecial(sector, sector->special);
|
||||
P_InitSectorSpecial(sector, sector->special, false);
|
||||
}
|
||||
|
||||
// Init other misc stuff
|
||||
|
|
|
@ -158,6 +158,7 @@ bool PIT_PushThing (AActor *thing);
|
|||
bool CheckIfExitIsGood (AActor *self, level_info_t *info);
|
||||
|
||||
// at map load
|
||||
void P_InitSectorSpecial(sector_t *sector, int special, bool nothinkers);
|
||||
void P_SpawnSpecials (void);
|
||||
|
||||
// every tic
|
||||
|
|
Loading…
Reference in a new issue