mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-12 07:01:09 +00:00
Remove the spike thinker, which hasn't been necessary for a while now
This commit is contained in:
parent
099ad6cf20
commit
9b27d004e3
4 changed files with 5 additions and 127 deletions
|
@ -1069,78 +1069,6 @@ void T_MarioBlock(levelspecthink_t *block)
|
||||||
#undef low
|
#undef low
|
||||||
}
|
}
|
||||||
|
|
||||||
void T_SpikeSector(levelspecthink_t *spikes)
|
|
||||||
{
|
|
||||||
mobj_t *thing;
|
|
||||||
msecnode_t *node;
|
|
||||||
boolean dothepain;
|
|
||||||
sector_t *affectsec;
|
|
||||||
|
|
||||||
node = spikes->sector->touching_thinglist; // things touching this sector
|
|
||||||
|
|
||||||
for (; node; node = node->m_thinglist_next)
|
|
||||||
{
|
|
||||||
thing = node->m_thing;
|
|
||||||
if (!thing->player)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
dothepain = false;
|
|
||||||
affectsec = §ors[spikes->vars[0]];
|
|
||||||
|
|
||||||
if (affectsec == spikes->sector) // Applied to an actual sector
|
|
||||||
{
|
|
||||||
fixed_t affectfloor = P_GetSpecialBottomZ(thing, affectsec, affectsec);
|
|
||||||
fixed_t affectceil = P_GetSpecialTopZ(thing, affectsec, affectsec);
|
|
||||||
|
|
||||||
if (affectsec->flags & SF_FLIPSPECIAL_FLOOR)
|
|
||||||
{
|
|
||||||
if (!(thing->eflags & MFE_VERTICALFLIP) && thing->momz > 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (thing->z == affectfloor)
|
|
||||||
dothepain = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (affectsec->flags & SF_FLIPSPECIAL_CEILING)
|
|
||||||
{
|
|
||||||
if ((thing->eflags & MFE_VERTICALFLIP) && thing->momz < 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (thing->z + thing->height == affectceil)
|
|
||||||
dothepain = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
fixed_t affectfloor = P_GetSpecialBottomZ(thing, affectsec, spikes->sector);
|
|
||||||
fixed_t affectceil = P_GetSpecialTopZ(thing, affectsec, spikes->sector);
|
|
||||||
if (affectsec->flags & SF_FLIPSPECIAL_FLOOR)
|
|
||||||
{
|
|
||||||
if (!(thing->eflags & MFE_VERTICALFLIP) && thing->momz > 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (thing->z == affectceil)
|
|
||||||
dothepain = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (affectsec->flags & SF_FLIPSPECIAL_CEILING)
|
|
||||||
{
|
|
||||||
if ((thing->eflags & MFE_VERTICALFLIP) && thing->momz < 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (thing->z + thing->height == affectfloor)
|
|
||||||
dothepain = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dothepain)
|
|
||||||
{
|
|
||||||
P_DamageMobj(thing, NULL, NULL, 1, DMG_SPIKE);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void T_FloatSector(levelspecthink_t *floater)
|
void T_FloatSector(levelspecthink_t *floater)
|
||||||
{
|
{
|
||||||
fixed_t cheeseheight;
|
fixed_t cheeseheight;
|
||||||
|
|
|
@ -1273,7 +1273,6 @@ typedef enum
|
||||||
tc_startcrumble,
|
tc_startcrumble,
|
||||||
tc_marioblock,
|
tc_marioblock,
|
||||||
tc_marioblockchecker,
|
tc_marioblockchecker,
|
||||||
tc_spikesector,
|
|
||||||
tc_floatsector,
|
tc_floatsector,
|
||||||
tc_crushceiling,
|
tc_crushceiling,
|
||||||
tc_scroll,
|
tc_scroll,
|
||||||
|
@ -2316,11 +2315,6 @@ static void P_NetArchiveThinkers(void)
|
||||||
SaveSpecialLevelThinker(th, tc_marioblockchecker);
|
SaveSpecialLevelThinker(th, tc_marioblockchecker);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (th->function.acp1 == (actionf_p1)T_SpikeSector)
|
|
||||||
{
|
|
||||||
SaveSpecialLevelThinker(th, tc_spikesector);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
else if (th->function.acp1 == (actionf_p1)T_FloatSector)
|
else if (th->function.acp1 == (actionf_p1)T_FloatSector)
|
||||||
{
|
{
|
||||||
SaveSpecialLevelThinker(th, tc_floatsector);
|
SaveSpecialLevelThinker(th, tc_floatsector);
|
||||||
|
@ -3547,10 +3541,6 @@ static void P_NetUnArchiveThinkers(void)
|
||||||
th = LoadSpecialLevelThinker((actionf_p1)T_MarioBlockChecker, 0);
|
th = LoadSpecialLevelThinker((actionf_p1)T_MarioBlockChecker, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case tc_spikesector:
|
|
||||||
th = LoadSpecialLevelThinker((actionf_p1)T_SpikeSector, 0);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case tc_floatsector:
|
case tc_floatsector:
|
||||||
th = LoadSpecialLevelThinker((actionf_p1)T_FloatSector, 0);
|
th = LoadSpecialLevelThinker((actionf_p1)T_FloatSector, 0);
|
||||||
break;
|
break;
|
||||||
|
|
49
src/p_spec.c
49
src/p_spec.c
|
@ -119,7 +119,6 @@ static void P_AddFloatThinker(sector_t *sec, INT32 tag, line_t *sourceline);
|
||||||
static void P_AddFakeFloorsByLine(size_t line, ffloortype_e ffloorflags, thinkerlist_t *secthinkers);
|
static void P_AddFakeFloorsByLine(size_t line, ffloortype_e ffloorflags, thinkerlist_t *secthinkers);
|
||||||
static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec);
|
static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec);
|
||||||
static void Add_Friction(INT32 friction, INT32 movefactor, INT32 affectee, INT32 referrer);
|
static void Add_Friction(INT32 friction, INT32 movefactor, INT32 affectee, INT32 referrer);
|
||||||
static void P_AddSpikeThinker(sector_t *sec, INT32 referrer);
|
|
||||||
static void P_AddPlaneDisplaceThinker(INT32 type, fixed_t speed, INT32 control, INT32 affectee, UINT8 reverse);
|
static void P_AddPlaneDisplaceThinker(INT32 type, fixed_t speed, INT32 control, INT32 affectee, UINT8 reverse);
|
||||||
|
|
||||||
|
|
||||||
|
@ -4446,7 +4445,8 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers
|
||||||
P_DamageMobj(player->mo, NULL, NULL, 1, DMG_ELECTRIC);
|
P_DamageMobj(player->mo, NULL, NULL, 1, DMG_ELECTRIC);
|
||||||
break;
|
break;
|
||||||
case 5: // Spikes
|
case 5: // Spikes
|
||||||
// Don't do anything. In Soviet Russia, spikes find you.
|
if (roversector || P_MobjReadyToTrigger(player->mo, sector))
|
||||||
|
P_DamageMobj(player->mo, NULL, NULL, 1, DMG_SPIKE);
|
||||||
break;
|
break;
|
||||||
case 6: // Death Pit (Camera Mod)
|
case 6: // Death Pit (Camera Mod)
|
||||||
case 7: // Death Pit (No Camera Mod)
|
case 7: // Death Pit (No Camera Mod)
|
||||||
|
@ -5754,7 +5754,6 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, f
|
||||||
thinker_t *th;
|
thinker_t *th;
|
||||||
friction_t *f;
|
friction_t *f;
|
||||||
pusher_t *p;
|
pusher_t *p;
|
||||||
levelspecthink_t *lst;
|
|
||||||
size_t sec2num;
|
size_t sec2num;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
|
@ -5855,16 +5854,8 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, f
|
||||||
else if (th == &thlist[THINK_MAIN])
|
else if (th == &thlist[THINK_MAIN])
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Should this FOF have spikeness?
|
|
||||||
if (th->function.acp1 == (actionf_p1)T_SpikeSector)
|
|
||||||
{
|
|
||||||
lst = (levelspecthink_t *)th;
|
|
||||||
|
|
||||||
if (lst->sector == sec2)
|
|
||||||
P_AddSpikeThinker(sec, (INT32)sec2num);
|
|
||||||
}
|
|
||||||
// Should this FOF have friction?
|
// Should this FOF have friction?
|
||||||
else if(th->function.acp1 == (actionf_p1)T_Friction)
|
if(th->function.acp1 == (actionf_p1)T_Friction)
|
||||||
{
|
{
|
||||||
f = (friction_t *)th;
|
f = (friction_t *)th;
|
||||||
|
|
||||||
|
@ -5928,28 +5919,6 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, f
|
||||||
// SPECIAL SPAWNING
|
// SPECIAL SPAWNING
|
||||||
//
|
//
|
||||||
|
|
||||||
/** Adds a spike thinker.
|
|
||||||
* Sector type Section1:5 will result in this effect.
|
|
||||||
*
|
|
||||||
* \param sec Sector in which to add the thinker.
|
|
||||||
* \param referrer If != sec, then we're dealing with a FOF
|
|
||||||
* \sa P_SpawnSpecials, T_SpikeSector
|
|
||||||
* \author SSNTails <http://www.ssntails.org>
|
|
||||||
*/
|
|
||||||
static void P_AddSpikeThinker(sector_t *sec, INT32 referrer)
|
|
||||||
{
|
|
||||||
levelspecthink_t *spikes;
|
|
||||||
|
|
||||||
// create and initialize new thinker
|
|
||||||
spikes = Z_Calloc(sizeof (*spikes), PU_LEVSPEC, NULL);
|
|
||||||
P_AddThinker(THINK_MAIN, &spikes->thinker);
|
|
||||||
|
|
||||||
spikes->thinker.function.acp1 = (actionf_p1)T_SpikeSector;
|
|
||||||
|
|
||||||
spikes->sector = sec;
|
|
||||||
spikes->vars[0] = referrer;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Adds a float thinker.
|
/** Adds a float thinker.
|
||||||
* Float thinkers cause solid 3Dfloors to float on water.
|
* Float thinkers cause solid 3Dfloors to float on water.
|
||||||
*
|
*
|
||||||
|
@ -6401,10 +6370,6 @@ void P_SpawnSpecials(boolean fromnetsave)
|
||||||
// Process Section 1
|
// Process Section 1
|
||||||
switch(GETSECSPECIAL(sector->special, 1))
|
switch(GETSECSPECIAL(sector->special, 1))
|
||||||
{
|
{
|
||||||
case 5: // Spikes
|
|
||||||
P_AddSpikeThinker(sector, (INT32)(sector-sectors));
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 15: // Bouncy sector
|
case 15: // Bouncy sector
|
||||||
CheckForBouncySector = true;
|
CheckForBouncySector = true;
|
||||||
break;
|
break;
|
||||||
|
@ -6450,9 +6415,7 @@ void P_SpawnSpecials(boolean fromnetsave)
|
||||||
// Firstly, find out how many there are in each sector
|
// Firstly, find out how many there are in each sector
|
||||||
for (th = thlist[THINK_MAIN].next; th != &thlist[THINK_MAIN]; th = th->next)
|
for (th = thlist[THINK_MAIN].next; th != &thlist[THINK_MAIN]; th = th->next)
|
||||||
{
|
{
|
||||||
if (th->function.acp1 == (actionf_p1)T_SpikeSector)
|
if (th->function.acp1 == (actionf_p1)T_Friction)
|
||||||
secthinkers[((levelspecthink_t *)th)->sector - sectors].count++;
|
|
||||||
else if (th->function.acp1 == (actionf_p1)T_Friction)
|
|
||||||
secthinkers[((friction_t *)th)->affectee].count++;
|
secthinkers[((friction_t *)th)->affectee].count++;
|
||||||
else if (th->function.acp1 == (actionf_p1)T_Pusher)
|
else if (th->function.acp1 == (actionf_p1)T_Pusher)
|
||||||
secthinkers[((pusher_t *)th)->affectee].count++;
|
secthinkers[((pusher_t *)th)->affectee].count++;
|
||||||
|
@ -6472,9 +6435,7 @@ void P_SpawnSpecials(boolean fromnetsave)
|
||||||
{
|
{
|
||||||
size_t secnum = (size_t)-1;
|
size_t secnum = (size_t)-1;
|
||||||
|
|
||||||
if (th->function.acp1 == (actionf_p1)T_SpikeSector)
|
if (th->function.acp1 == (actionf_p1)T_Friction)
|
||||||
secnum = ((levelspecthink_t *)th)->sector - sectors;
|
|
||||||
else if (th->function.acp1 == (actionf_p1)T_Friction)
|
|
||||||
secnum = ((friction_t *)th)->affectee;
|
secnum = ((friction_t *)th)->affectee;
|
||||||
else if (th->function.acp1 == (actionf_p1)T_Pusher)
|
else if (th->function.acp1 == (actionf_p1)T_Pusher)
|
||||||
secnum = ((pusher_t *)th)->affectee;
|
secnum = ((pusher_t *)th)->affectee;
|
||||||
|
|
|
@ -381,7 +381,6 @@ void T_ContinuousFalling(levelspecthink_t *faller);
|
||||||
void T_BounceCheese(levelspecthink_t *bouncer);
|
void T_BounceCheese(levelspecthink_t *bouncer);
|
||||||
void T_StartCrumble(elevator_t *elevator);
|
void T_StartCrumble(elevator_t *elevator);
|
||||||
void T_MarioBlock(levelspecthink_t *block);
|
void T_MarioBlock(levelspecthink_t *block);
|
||||||
void T_SpikeSector(levelspecthink_t *spikes);
|
|
||||||
void T_FloatSector(levelspecthink_t *floater);
|
void T_FloatSector(levelspecthink_t *floater);
|
||||||
void T_MarioBlockChecker(levelspecthink_t *block);
|
void T_MarioBlockChecker(levelspecthink_t *block);
|
||||||
void T_ThwompSector(levelspecthink_t *thwomp);
|
void T_ThwompSector(levelspecthink_t *thwomp);
|
||||||
|
|
Loading…
Reference in a new issue