Nuke a bunch of iteration things that have no purpose in SRB2Kart. A full explanation of my reasoning and what it affects is as follows.

p_inter.c -
	Everything to do with setting states for starposts
		In SRB2Kart, starposts are invisble. We don't need to loop through all thinkers just to set their states when there's no visible effect of the state-setting. In addition, it has no consequences for gameplay - starposts have long been silent here, and all checking is done regarding their health, not their state.
	Remove extremely low-traffic conditionals (MT_FLINGEMERALD collision height extension, for example)
		These objects serve no functional purpose during regular SRB2Kart gameplay. Why should every other object have to pay an admittedly minor performance hit just for them?
	Disable all mechanisms of damaging bosses or enemies with the player's physical contact
		With the exception of Sapphire Coast, no MF_ENEMY objects exist in the entirety of the standard roster. In addition, the conditions for damaging the enemies were impossible to achieve, because they required vanilla SRB2 mechanics such as "jumping", "spindashing", or "super". Therefore, they can be safely commented out.
	Disable NiGHTS-related material (excepting bumper, hoop, and wing-emblem objects)
		NiGHTS is fundamentally incompatible with regular kart gameplay and I believe was already broken. Therefore, any mechanism which enters, aids, or abets it can be safely disabled.
	Comment out Tag mechanisms
		Tag is the only vanilla multiplayer gametype which has sufficient gameplay depth and complexity (HEYOOOOOOOOO) to require dedicated thinking in and of itself in order to manage. This thinking is irrelevant to Kart's functioning, and can be neutered easily.
d_clisrv.c
	Comment out Tag mechanisms
		See p_inter.c
d_netcmd.c
	Disable several devmode commands which are irrelevant to SRB2Kart gameplay
		When investigating for references to NiGHTS material, I discovered that these remained untouched. In order to present a more coherent game, I have hidden the ones that serve no purpose for us.
	Comment out Tag mechanisms
		See p_inter.c
g_game.c
	Disable NiGHTS-related material
		See p_inter.c
	Disable some team-related material
		Teams are not present in SRB2Kart at present. Obviously we'd want to reconsider for future, but it doesn't need to be run right now.
	Everything to do with setting states for starposts
		See p_inter.c
m_cheat.c
	Disable several devmode commands which are irrelevant to SRB2Kart gameplay
		See d_netcmd.c
p_map.c
	Remove extremely low-traffic conditionals (MT_EGGSHIELD collision, for example)
		See p_inter.c
	Disable NiGHTS-related material
		See p_inter.c
p_mobj.c
	Disable P_EmeraldManager
		Power stones, despite their relevance in vanilla Match, are not in SRB2Kart's Battle. No management of nonexistent emeralds is required.
p_setup.c
	Everything to do with setting states for starposts
		See p_inter.c
p_spec.c
	Disable NiGHTS-related material
		See p_inter.c
	Everything to do with setting states for starposts
		See p_inter.c
p_telept.c
	Everything to do with setting states for starposts
		See p_inter.c
p_tick.c
	Disable some team-related material
		See g_game.c
	Disable P_EmeraldManager
		See p_mobj.c
	Do not run shields
		Shield objects are not run under the vanilla system; the Thunder Shield is a domain-specific recreation using a standard mobjthinker.
	Do not run special stages
		SRB2Kart does not have special stages.
	Comment out Tag mechanisms
		See p_inter.c
y_inter.c
	Disable some team-related material
		See g_game.c
p_user.c
	Disable NiGHTS-related material
		See p_inter.c
	Disable 2d movement for players
		2D mode? In a kart racer? :nick:
This commit is contained in:
toaster 2018-10-03 17:04:41 +01:00
parent 76e0ff6dc7
commit cfd2b021a4
15 changed files with 102 additions and 212 deletions

View File

@ -2491,9 +2491,9 @@ static void CL_RemovePlayer(INT32 playernum)
LUA_InvalidatePlayer(&players[playernum]);
#endif
if (G_TagGametype()) //Check if you still have a game. Location flexible. =P
/*if (G_TagGametype()) //Check if you still have a game. Location flexible. =P
P_CheckSurvivors();
else if (G_BattleGametype()) // SRB2Kart
else*/ if (G_BattleGametype()) // SRB2Kart
K_CheckBumpers();
else if (G_RaceGametype())
P_CheckRacers();

View File

@ -915,19 +915,19 @@ void D_RegisterClientCommands(void)
COM_AddCommand("noclip", Command_CheatNoClip_f);
COM_AddCommand("god", Command_CheatGod_f);
COM_AddCommand("notarget", Command_CheatNoTarget_f);
COM_AddCommand("getallemeralds", Command_Getallemeralds_f);
/*COM_AddCommand("getallemeralds", Command_Getallemeralds_f);
COM_AddCommand("resetemeralds", Command_Resetemeralds_f);
COM_AddCommand("setrings", Command_Setrings_f);
COM_AddCommand("setlives", Command_Setlives_f);
COM_AddCommand("setcontinues", Command_Setcontinues_f);
COM_AddCommand("setcontinues", Command_Setcontinues_f);*/
COM_AddCommand("devmode", Command_Devmode_f);
COM_AddCommand("savecheckpoint", Command_Savecheckpoint_f);
COM_AddCommand("scale", Command_Scale_f);
COM_AddCommand("gravflip", Command_Gravflip_f);
COM_AddCommand("hurtme", Command_Hurtme_f);
COM_AddCommand("jumptoaxis", Command_JumpToAxis_f);
/*COM_AddCommand("jumptoaxis", Command_JumpToAxis_f);
COM_AddCommand("charability", Command_Charability_f);
COM_AddCommand("charspeed", Command_Charspeed_f);
COM_AddCommand("charspeed", Command_Charspeed_f);*/
COM_AddCommand("teleport", Command_Teleport_f);
COM_AddCommand("rteleport", Command_RTeleport_f);
COM_AddCommand("skynum", Command_Skynum_f);
@ -3260,9 +3260,9 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
}
// In tag, check to see if you still have a game.
if (G_TagGametype())
/*if (G_TagGametype())
P_CheckSurvivors();
else if (G_BattleGametype())
else*/ if (G_BattleGametype())
K_CheckBumpers(); // SRB2Kart
else if (G_RaceGametype())
P_CheckRacers(); // also SRB2Kart

View File

@ -2554,15 +2554,15 @@ void G_PlayerReborn(INT32 player)
p->maxlink = 0;
// If NiGHTS, find lowest mare to start with.
p->mare = P_FindLowestMare();
p->mare = 0; /*P_FindLowestMare();
CONS_Debug(DBG_NIGHTS, M_GetText("Current mare is %d\n"), p->mare);
if (p->mare == 255)
p->mare = 0;
p->mare = 0;*/
// Check to make sure their color didn't change somehow...
if (G_GametypeHasTeams())
/*if (G_GametypeHasTeams())
{
if (p->ctfteam == 1 && p->skincolor != skincolor_redteam)
{
@ -2586,7 +2586,7 @@ void G_PlayerReborn(INT32 player)
else if (p == &players[fourthdisplayplayer])
CV_SetValue(&cv_playercolor4, skincolor_blueteam);
}
}
}*/
}
//
@ -2967,8 +2967,6 @@ void G_DoReborn(INT32 playernum)
P_LoadThingsOnly();
P_ClearStarPost(player->starpostnum);
// Do a wipe
wipegamestate = -1;

View File

@ -377,7 +377,7 @@ void Command_Hurtme_f(void)
}
// Moves the NiGHTS player to another axis within the current mare
void Command_JumpToAxis_f(void)
/*void Command_JumpToAxis_f(void)
{
REQUIRE_DEVMODE;
REQUIRE_INLEVEL;
@ -438,7 +438,7 @@ void Command_Charspeed_f(void)
players[consoleplayer].actionspd = atoi(COM_Argv(2))<<FRACBITS;
else
CONS_Printf(M_GetText("charspeed <normalspeed/runspeed/thrustfactor/accelstart/acceleration/actionspd> <value>: set character speed\n"));
}
}*/
void Command_RTeleport_f(void)
{
@ -683,7 +683,7 @@ void Command_Savecheckpoint_f(void)
}
// Like M_GetAllEmeralds() but for console devmode junkies.
void Command_Getallemeralds_f(void)
/*void Command_Getallemeralds_f(void)
{
REQUIRE_SINGLEPLAYER;
REQUIRE_NOULTIMATE;
@ -702,7 +702,7 @@ void Command_Resetemeralds_f(void)
emeralds = 0;
CONS_Printf(M_GetText("Emeralds reset to zero.\n"));
}
}*/
void Command_Devmode_f(void)
{
@ -730,7 +730,7 @@ void Command_Devmode_f(void)
G_SetGameModified(multiplayer);
}
void Command_Setrings_f(void)
/*void Command_Setrings_f(void)
{
REQUIRE_INLEVEL;
REQUIRE_SINGLEPLAYER;
@ -785,7 +785,7 @@ void Command_Setcontinues_f(void)
G_SetGameModified(multiplayer);
}
}
}*/
//
// OBJECTPLACE (and related variables)

View File

@ -48,18 +48,18 @@ void Command_CheatNoClip_f(void);
void Command_CheatGod_f(void);
void Command_CheatNoTarget_f(void);
void Command_Savecheckpoint_f(void);
void Command_Getallemeralds_f(void);
/*void Command_Getallemeralds_f(void);
void Command_Resetemeralds_f(void);
void Command_Setrings_f(void);
void Command_Setlives_f(void);
void Command_Setcontinues_f(void);
void Command_Setcontinues_f(void);*/
void Command_Devmode_f(void);
void Command_Scale_f(void);
void Command_Gravflip_f(void);
void Command_Hurtme_f(void);
void Command_JumpToAxis_f(void);
/*void Command_JumpToAxis_f(void);
void Command_Charability_f(void);
void Command_Charspeed_f(void);
void Command_Charspeed_f(void);*/
void Command_Teleport_f(void);
void Command_RTeleport_f(void);
void Command_Skynum_f(void);

View File

@ -96,55 +96,6 @@ void P_RampConstant(const BasicFF_t *FFInfo, INT32 Start, INT32 End)
// GET STUFF
//
/** Makes sure all previous starposts are cleared.
* For instance, hitting starpost 5 will clear starposts 1 through 4, even if
* you didn't touch them. This is how the classic games work, although it can
* lead to bizarre situations on levels that allow you to make a circuit.
*
* \param postnum The number of the starpost just touched.
*/
void P_ClearStarPost(INT32 postnum)
{
thinker_t *th;
mobj_t *mo2;
// scan the thinkers
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
mo2 = (mobj_t *)th;
if (mo2->type == MT_STARPOST && mo2->health <= postnum)
P_SetMobjState(mo2, mo2->info->seestate);
}
return;
}
//
// P_ResetStarposts
//
// Resets all starposts back to their spawn state, used on A_Mixup and some other things.
//
void P_ResetStarposts(void)
{
// Search through all the thinkers.
thinker_t *th;
mobj_t *post;
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
post = (mobj_t *)th;
if (post->type == MT_STARPOST)
P_SetMobjState(post, post->info->spawnstate);
}
}
//
// P_CanPickupItem
//
@ -299,14 +250,14 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
if (heightcheck)
{
if (special->type == MT_FLINGEMERALD) // little hack here...
/*if (special->type == MT_FLINGEMERALD) // little hack here...
{ // flingemerald sprites are low to the ground, so extend collision radius down some.
if (toucher->z > (special->z + special->height))
return;
if (special->z - special->height > (toucher->z + toucher->height))
return;
}
else
else*/
{
if (toucher->momz < 0) {
if (toucher->z + toucher->momz > special->z + special->height)
@ -341,7 +292,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
if (special->flags & MF_BOSS)
{
if (special->type == MT_BLACKEGGMAN)
/*if (special->type == MT_BLACKEGGMAN)
{
P_DamageMobj(toucher, special, special, 1); // ouch
return;
@ -357,7 +308,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
toucher->momy = -toucher->momy;
P_DamageMobj(special, toucher, toucher, 1);
}
/*
else if (((toucher->z < special->z && !(toucher->eflags & MFE_VERTICALFLIP))
|| (toucher->z + toucher->height > special->z + special->height && (toucher->eflags & MFE_VERTICALFLIP)))
&& player->charability == CA_FLY
@ -368,8 +318,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
P_DamageMobj(special, toucher, toucher, 1);
}
*/ // SRB2kart - Removed: No more fly states
else
// SRB2kart - Removed: No more fly states
else*/
P_DamageMobj(toucher, special, special, 1);
return;
@ -379,7 +329,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
////////////////////////////////////////////////////////
/////ENEMIES!!//////////////////////////////////////////
////////////////////////////////////////////////////////
if (special->type == MT_GSNAPPER && !(((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING))
/*if (special->type == MT_GSNAPPER && !(((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING))
|| player->powers[pw_invulnerability] || player->powers[pw_super])
&& toucher->z < special->z + special->height && toucher->z + toucher->height > special->z)
{
@ -401,7 +351,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
P_DamageMobj(special, toucher, toucher, 1);
}
/*
else if (((toucher->z < special->z && !(toucher->eflags & MFE_VERTICALFLIP))
|| (toucher->z + toucher->height > special->z + special->height && (toucher->eflags & MFE_VERTICALFLIP))) // Flame is bad at logic - JTE
&& player->charability == CA_FLY
@ -413,8 +362,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
P_DamageMobj(special, toucher, toucher, 1);
}
*/ // SRB2kart - Removed: No more fly states
else
// SRB2kart - Removed: No more fly states
else*/
P_DamageMobj(toucher, special, special, 1);
return;
@ -843,7 +792,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
// ********************************** //
// NiGHTS gameplay items and powerups //
// ********************************** //
case MT_NIGHTSDRONE:
/*case MT_NIGHTSDRONE:
if (player->bot)
return;
if (player->exiting)
@ -1034,7 +983,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
// Clear text
player->texttimer = 0;
return;
return;*/
case MT_NIGHTSBUMPER:
// Don't trigger if the stage is ended/failed
if (player->exiting)
@ -1102,7 +1051,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
}
}
return;
case MT_NIGHTSSUPERLOOP:
/*case MT_NIGHTSSUPERLOOP:
if (player->bot || !(player->pflags & PF_NIGHTSMODE))
return;
if (!G_IsSpecialStage(gamemap))
@ -1235,7 +1184,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
HU_SetCEchoDuration(4);
HU_DoCEcho(M_GetText("\\\\\\\\\\\\\\\\Link Freeze"));
}
break;
break;*/
case MT_NIGHTSWING:
if (G_IsSpecialStage(gamemap) && useNightsSS)
{ // Pseudo-ring.
@ -1387,35 +1336,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
player->starpostangle = special->angle;
player->starpostnum = special->health;
player->starpostcount++;
P_ClearStarPost(special->health);
// Find all starposts in the level with this value.
{
thinker_t *th;
mobj_t *mo2;
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
mo2 = (mobj_t *)th;
if (mo2 == special)
continue;
if (mo2->type == MT_STARPOST && mo2->health == special->health)
{
if (!(netgame && circuitmap && player != &players[consoleplayer]))
P_SetMobjState(mo2, mo2->info->painstate);
}
}
}
S_StartSound(toucher, special->info->painsound);
if (!(netgame && circuitmap && player != &players[consoleplayer]))
P_SetMobjState(special, special->info->painstate);
//S_StartSound(toucher, special->info->painsound);
return;
case MT_FAKEMOBILE:
@ -1914,7 +1836,7 @@ void P_CheckTimeLimit(void)
//Tagmode round end but only on the tic before the
//XD_EXITLEVEL packet is received by all players.
if (G_TagGametype())
/*if (G_TagGametype())
{
if (leveltime == (timelimitintics + 1))
{
@ -1931,7 +1853,7 @@ void P_CheckTimeLimit(void)
}
//Optional tie-breaker for Match/CTF
else if (cv_overtime.value)
else*/ if (cv_overtime.value)
{
INT32 playerarray[MAXPLAYERS];
INT32 tempplayer = 0;
@ -2064,7 +1986,7 @@ void P_CheckPointLimit(void)
/*Checks for untagged remaining players in both tag derivitave modes.
*If no untagged players remain, end the round.
*Also serves as error checking if the only IT player leaves.*/
void P_CheckSurvivors(void)
/*void P_CheckSurvivors(void)
{
INT32 i;
INT32 survivors = 0;
@ -2144,7 +2066,7 @@ void P_CheckSurvivors(void)
if (server)
SendNetXCmd(XD_EXITLEVEL, NULL, 0);
}
}
}*/
// Checks whether or not to end a race netgame.
boolean P_CheckRacers(void)
@ -2444,7 +2366,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
localaiming4 = 0;
//tag deaths handled differently in suicide cases. Don't count spectators!
if (G_TagGametype()
/*if (G_TagGametype()
&& !(target->player->pflags & PF_TAGIT) && (!source || !source->player) && !(target->player->spectator))
{
// if you accidentally die before you run out of time to hide, ignore it.
@ -2478,7 +2400,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
}
}
}
else if (G_BattleGametype())
else*/ if (G_BattleGametype())
K_CheckBumpers();
target->player->kartstuff[k_pogospring] = 0;
@ -2841,7 +2763,7 @@ static inline boolean P_TagDamage(mobj_t *target, mobj_t *inflictor, mobj_t *sou
}
// The tag occurs so long as you aren't shooting another tagger with friendlyfire on.
if (source->player->pflags & PF_TAGIT && !(player->pflags & PF_TAGIT))
/*if (source->player->pflags & PF_TAGIT && !(player->pflags & PF_TAGIT))
{
P_AddPlayerScore(source->player, 1); //award points to tagger.
P_HitDeathMessages(player, inflictor, source);
@ -2859,7 +2781,7 @@ static inline boolean P_TagDamage(mobj_t *target, mobj_t *inflictor, mobj_t *sou
//checks if tagger has tagged all players, if so, end round early.
P_CheckSurvivors();
}
}*/
P_DoPlayerPain(player, source, inflictor);

View File

@ -172,7 +172,7 @@ void P_PlayerThink(player_t *player);
void P_PlayerAfterThink(player_t *player);
void P_DoPlayerExit(player_t *player);
void P_DoTimeOver(player_t *player);
void P_NightserizePlayer(player_t *player, INT32 ptime);
//void P_NightserizePlayer(player_t *player, INT32 ptime);
void P_InstaThrust(mobj_t *mo, angle_t angle, fixed_t move);
fixed_t P_ReturnThrustX(mobj_t *mo, angle_t angle, fixed_t move);
@ -185,12 +185,12 @@ void P_HomingAttack(mobj_t *source, mobj_t *enemy); /// \todo doesn't belong in
//boolean P_SuperReady(player_t *player);
void P_DoJump(player_t *player, boolean soundandstate);
boolean P_AnalogMove(player_t *player);
boolean P_TransferToNextMare(player_t *player);
UINT8 P_FindLowestMare(void);
/*boolean P_TransferToNextMare(player_t *player);
UINT8 P_FindLowestMare(void);*/
UINT8 P_FindLowestLap(void);
UINT8 P_FindHighestLap(void);
void P_FindEmerald(void);
void P_TransferToAxis(player_t *player, INT32 axisnum);
//void P_TransferToAxis(player_t *player, INT32 axisnum);
boolean P_PlayerMoving(INT32 pnum);
void P_SpawnThokMobj(player_t *player);
void P_SpawnSpinMobj(player_t *player, mobjtype_t type);
@ -406,12 +406,9 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck);
void P_PlayerFlagBurst(player_t *player, boolean toss);
void P_CheckTimeLimit(void);
void P_CheckPointLimit(void);
void P_CheckSurvivors(void);
//void P_CheckSurvivors(void);
boolean P_CheckRacers(void);
void P_ClearStarPost(INT32 postnum);
void P_ResetStarposts(void);
boolean P_CanPickupItem(player_t *player, UINT8 weapon);
void P_DoNightsScore(player_t *player);

View File

@ -469,7 +469,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
#endif
// Metal Sonic destroys tiny baby objects.
if (tmthing->type == MT_METALSONIC_RACE
/*if (tmthing->type == MT_METALSONIC_RACE
&& (thing->flags & (MF_MISSILE|MF_ENEMY|MF_BOSS) || thing->type == MT_SPIKE))
{
if ((thing->flags & (MF_ENEMY|MF_BOSS)) && (thing->health <= 0 || !(thing->flags & MF_SHOOTABLE)))
@ -495,7 +495,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
P_KillMobj(thing, tmthing, tmthing);
}
return true;
}
}*/
if (!(thing->flags & (MF_SOLID|MF_SPECIAL|MF_PAIN|MF_SHOOTABLE)) || (thing->flags & MF_NOCLIPTHING))
return true;
@ -647,9 +647,9 @@ static boolean PIT_CheckThing(mobj_t *thing)
// check for skulls slamming into things
if (tmthing->flags2 & MF2_SKULLFLY)
{
if (tmthing->type == MT_EGGMOBILE) // Don't make Eggman stop!
/*if (tmthing->type == MT_EGGMOBILE) // Don't make Eggman stop!
return true; // Let him RUN YOU RIGHT OVER. >:3
else
else*/
{
// see if it went over / under
if (tmthing->z > thing->z + thing->height)
@ -1133,7 +1133,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
return true;
// Missiles ignore Brak's helper.
if (thing->type == MT_BLACKEGGMAN_HELPER)
/*if (thing->type == MT_BLACKEGGMAN_HELPER)
return true;
// Hurting Brak
@ -1144,9 +1144,9 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (!(thing->state >= &states[S_BLACKEGG_PAIN1] && thing->state <= &states[S_BLACKEGG_PAIN35]))
P_SetMobjState(thing, thing->info->painstate);
return false;
}
}*/
if (!(thing->flags & MF_SHOOTABLE) && !(thing->type == MT_EGGSHIELD))
if (!(thing->flags & MF_SHOOTABLE)/* && !(thing->type == MT_EGGSHIELD)*/)
{
// didn't do any damage
return !(thing->flags & MF_SOLID);
@ -1157,7 +1157,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
&& thing->player->pflags & PF_CARRIED && thing->tracer == tmthing->target)
return true; // Don't give rings to your carry player by accident.
if (thing->type == MT_EGGSHIELD)
/*if (thing->type == MT_EGGSHIELD)
{
fixed_t touchx, touchy;
angle_t angle;
@ -1183,14 +1183,14 @@ static boolean PIT_CheckThing(mobj_t *thing)
P_KillMobj(thing, tmthing, tmthing);
return false;
}
}
}*/
if (tmthing->type == MT_SHELL && tmthing->threshold > TICRATE)
return true;
// damage / explode
if (tmthing->flags & MF_ENEMY) // An actual ENEMY! (Like the deton, for example)
P_DamageMobj(thing, tmthing, tmthing, 1);
else if (tmthing->type == MT_BLACKEGGMAN_MISSILE && thing->player
/*else if (tmthing->type == MT_BLACKEGGMAN_MISSILE && thing->player
&& (thing->player->pflags & PF_JUMPED)
&& !thing->player->powers[pw_flashing]
&& thing->tracer != tmthing
@ -1230,16 +1230,13 @@ static boolean PIT_CheckThing(mobj_t *thing)
tmthing->x = thing->x;
tmthing->y = thing->y;
P_SetThingPosition(tmthing);
}
}*/
else
P_DamageMobj(thing, tmthing, tmthing->target, 1);
// don't traverse any more
if (tmthing->type == MT_SHELL)
return true;
else
return false;
return (tmthing->type == MT_SHELL);
}
if (thing->flags & MF_PUSHABLE && (tmthing->player || tmthing->flags & MF_PUSHABLE)
@ -1303,7 +1300,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
}
// Respawn rings and items
if ((tmthing->type == MT_NIGHTSDRONE || thing->type == MT_NIGHTSDRONE)
/*if ((tmthing->type == MT_NIGHTSDRONE || thing->type == MT_NIGHTSDRONE)
&& (tmthing->player || thing->player))
{
mobj_t *droneobj = (tmthing->type == MT_NIGHTSDRONE) ? tmthing : thing;
@ -1323,7 +1320,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
}
droneobj->extravalue1 = pl->anotherflyangle;
droneobj->extravalue2 = (INT32)leveltime + TICRATE;
}
}*/
// check for special pickup
if (thing->flags & MF_SPECIAL && tmthing->player && thing->type != MT_POKEY)
@ -1394,7 +1391,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
else if (thing->scale > tmthing->scale + (FRACUNIT/8))
K_SquishPlayer(tmthing->player, thing);
// SRB2kart - Starpower!
// SRB2kart - Invincibility!
if (tmthing->player->kartstuff[k_invincibilitytimer] && !thing->player->kartstuff[k_invincibilitytimer])
P_DamageMobj(thing, tmthing, tmthing, 1);
else if (thing->player->kartstuff[k_invincibilitytimer] && !tmthing->player->kartstuff[k_invincibilitytimer])
@ -1440,7 +1437,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (thing->player)
{
// Doesn't matter what gravity player's following! Just do your stuff in YOUR direction only
if (tmthing->eflags & MFE_VERTICALFLIP
/*if (tmthing->eflags & MFE_VERTICALFLIP
&& (tmthing->z + tmthing->height + tmthing->momz < thing->z
|| tmthing->z + tmthing->height + tmthing->momz >= thing->z + thing->height))
;
@ -1462,7 +1459,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
// The tmthing->target allows the pusher of the object
// to get the point if he topples it on an opponent.
}
}
}*/
if (tmthing->type == MT_FAN || tmthing->type == MT_STEAM)
P_DoFanAndGasJet(tmthing, thing);
@ -1585,9 +1582,9 @@ static boolean PIT_CheckThing(mobj_t *thing)
; // Fix a few nasty spring-jumping bugs that happen sometimes.
// Monitors are not treated as solid to players who are jumping, spinning or gliding,
// unless it's a CTF team monitor and you're on the wrong team
else if (thing->flags & MF_MONITOR && tmthing->player && tmthing->player->pflags & (PF_JUMPED|PF_SPINNING|PF_GLIDING)
/*else if (thing->flags & MF_MONITOR && tmthing->player && tmthing->player->pflags & (PF_JUMPED|PF_SPINNING|PF_GLIDING)
&& !((thing->type == MT_REDRINGBOX && tmthing->player->ctfteam != 1) || (thing->type == MT_BLUERINGBOX && tmthing->player->ctfteam != 2)))
;
;*/
// z checking at last
// Treat noclip things as non-solid!
else if ((thing->flags & (MF_SOLID|MF_NOCLIP)) == MF_SOLID

View File

@ -495,7 +495,7 @@ boolean P_WeaponOrPanel(mobjtype_t type)
//
// Power Stone emerald management
//
void P_EmeraldManager(void)
/*void P_EmeraldManager(void)
{
thinker_t *think;
mobj_t *mo;
@ -664,7 +664,7 @@ void P_EmeraldManager(void)
break;
}
}
}
}*/
//
// P_ExplodeMissile

View File

@ -2865,7 +2865,6 @@ boolean P_SetupLevel(boolean skipprecip)
if (players[i].starposttime)
{
G_SpawnPlayer(i, true);
P_ClearStarPost(players[i].starpostnum);
}
else
G_SpawnPlayer(i, false);

View File

@ -1707,16 +1707,16 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller
if (actor && actor->player && triggerline->flags & ML_EFFECT4)
{
if (maptol & TOL_NIGHTS)
/*if (maptol & TOL_NIGHTS)
lap = actor->player->mare;
else
else*/
lap = actor->player->laps;
}
else
{
if (maptol & TOL_NIGHTS)
/*if (maptol & TOL_NIGHTS)
lap = P_FindLowestMare();
else
else*/
lap = P_FindLowestLap();
}
@ -4252,7 +4252,6 @@ DoneSection2:
//
//player->starpostangle = player->starposttime = player->starpostnum = 0;
//player->starpostx = player->starposty = player->starpostz = 0;
P_ResetStarposts();
// Play the starpost sound for 'consistency'
// S_StartSound(player->mo, sfx_strpst);

View File

@ -96,10 +96,6 @@ void P_MixUp(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle,
thing->player->starpostangle = starpostangle;
thing->player->starpostnum = starpostnum;
// Reset map starposts for the player's new info.
P_ResetStarposts();
P_ClearStarPost(starpostnum);
P_ResetPlayer(thing->player);
P_SetPlayerMobjState(thing, S_KART_STND1); // SRB2kart - was S_PLAY_STND

View File

@ -310,7 +310,7 @@ static inline void P_RunThinkers(void)
//
// Determine if the teams are unbalanced, and if so, move a player to the other team.
//
static void P_DoAutobalanceTeams(void)
/*static void P_DoAutobalanceTeams(void)
{
changeteam_union NetPacket;
UINT16 usvalue;
@ -562,7 +562,7 @@ static inline void P_DoCTFStuff(void)
if (cv_teamscramble.value && server)
P_DoTeamscrambling();
}
}
}*/
//
// P_Ticker
@ -612,11 +612,11 @@ void P_Ticker(boolean run)
if (!demoplayback) // Don't increment if a demo is playing.
totalplaytime++;
if (!useNightsSS && G_IsSpecialStage(gamemap))
/*if (!useNightsSS && G_IsSpecialStage(gamemap))
P_DoSpecialStageStuff();
if (runemeraldmanager)
P_EmeraldManager(); // Power stone mode
P_EmeraldManager(); // Power stone mode*/
if (run)
{
@ -633,7 +633,7 @@ void P_Ticker(boolean run)
}
// Run shield positioning
P_RunShields();
//P_RunShields();
P_RunOverlays();
P_RunShadows();
@ -648,11 +648,11 @@ void P_Ticker(boolean run)
leveltime++;
timeinmap++;
if (G_TagGametype())
/*if (G_TagGametype())
P_DoTagStuff();
if (G_GametypeHasTeams())
P_DoCTFStuff();
P_DoCTFStuff();*/
if (run)
{
@ -793,7 +793,7 @@ void P_PreTicker(INT32 frames)
#endif
// Run shield positioning
P_RunShields();
//P_RunShields();
P_RunOverlays();
P_UpdateSpecials();

View File

@ -344,7 +344,7 @@ void P_ResetScore(player_t *player)
//
// Returns the lowest open mare available
//
UINT8 P_FindLowestMare(void)
/*UINT8 P_FindLowestMare(void)
{
thinker_t *th;
mobj_t *mo2;
@ -375,7 +375,7 @@ UINT8 P_FindLowestMare(void)
CONS_Debug(DBG_NIGHTS, "Lowest mare found: %d\n", mare);
return mare;
}
}*/
//
// P_FindLowestLap
@ -438,7 +438,7 @@ UINT8 P_FindHighestLap(void)
// (Finds the lowest mare # for capsules that have not been destroyed).
// Returns true if successful, false if there is no other mare.
//
boolean P_TransferToNextMare(player_t *player)
/*boolean P_TransferToNextMare(player_t *player)
{
thinker_t *th;
mobj_t *mo2;
@ -759,7 +759,7 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
if (G_IsSpecialStage(gamemap))
{
for (i = 0; i < MAXPLAYERS; i++)
if (playeringame[i]/* && players[i].pflags & PF_NIGHTSMODE*/)
if (playeringame[i])
total_rings += players[i].health-1;
}
@ -782,10 +782,6 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
P_AddPlayerScore(&players[i], (players[i].health - 1) * 50);
}
// Add score to leaderboards now
/*if (!(netgame||multiplayer) && P_IsLocalPlayer(&players[i]))
G_AddTempNightsRecords(players[i].marescore, leveltime - player->marebegunat, players[i].mare + 1);*/
// transfer scores anyway
players[i].mo->health = players[i].health = 1;
@ -803,10 +799,6 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
player->textvar = 4; // Score and grades
player->finishedrings = (INT16)(player->health - 1);
// Add score to temp leaderboards
/*if (!(netgame||multiplayer) && P_IsLocalPlayer(player))
G_AddTempNightsRecords(player->marescore, leveltime - player->marebegunat, (UINT8)(oldmare + 1));*/
// Starting a new mare, transfer scores
player->marebegunat = leveltime;
@ -824,7 +816,7 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
}
player->pflags |= PF_NIGHTSMODE;
}
}*/
//
// P_PlayerInPain
@ -4536,7 +4528,7 @@ INT32 P_GetPlayerControlDirection(player_t *player)
}
// Control scheme for 2d levels.
static void P_2dMovement(player_t *player)
/*static void P_2dMovement(player_t *player)
{
ticcmd_t *cmd;
INT32 topspeed, acceleration, thrustfactor;
@ -4713,7 +4705,7 @@ static void P_2dMovement(player_t *player)
else if (player->rmomx > -topspeed && cmd->sidemove < 0)
P_Thrust(player->mo, movepushangle, movepushforward);
}
}
}*/
//#define OLD_MOVEMENT_CODE 1
static void P_3dMovement(player_t *player)
@ -5004,7 +4996,7 @@ static void P_SpectatorMovement(player_t *player)
// graphical indicator
// for building/debugging
// NiGHTS levels!
static void P_ShootLine(mobj_t *source, mobj_t *dest, fixed_t height)
/*static void P_ShootLine(mobj_t *source, mobj_t *dest, fixed_t height)
{
mobj_t *mo;
INT32 i;
@ -5578,16 +5570,6 @@ static void P_DoNiGHTSCapsule(player_t *player)
UINT8 em = P_GetNextEmerald();
tic_t lowest_time;
/*for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i] || players[i].spectator || !players[i].mo || !players[i].mo->tracer)
continue;
emmo = P_SpawnMobj(players[i].mo->x, players[i].mo->y, players[i].mo->z + players[i].mo->info->height, MT_GOTEMERALD);
P_SetTarget(&emmo->target, players[i].mo);
P_SetMobjState(emmo, mobjinfo[MT_GOTEMERALD].meleestate + em);
}*/
if (player->mo->tracer)
{
// Only give it to ONE person, and THAT player has to get to the goal!
@ -5683,7 +5665,7 @@ static void P_NiGHTSMovement(player_t *player)
boolean capsule = false;
// NiGHTS special stages have a pseudo-shared timer, so check if ANYONE is feeding the capsule.
for (i = 0; i < MAXPLAYERS; i++)
if (playeringame[i] /*&& players[i].pflags & PF_NIGHTSMODE*/
if (playeringame[i]
&& (players[i].capsule && players[i].capsule->reactiontime))
capsule = true;
if (!capsule
@ -6238,7 +6220,7 @@ static void P_NiGHTSMovement(player_t *player)
if (objectplacing)
OP_NightsObjectplace(player);
}
}*/
// May be used in future for CTF
#if 0
@ -6457,7 +6439,7 @@ void P_ElementalFireTrail(player_t *player)
static void P_MovePlayer(player_t *player)
{
ticcmd_t *cmd;
INT32 i;
//INT32 i;
fixed_t runspd;
@ -6532,7 +6514,7 @@ static void P_MovePlayer(player_t *player)
}
// Locate the capsule for this mare.
else if (maptol & TOL_NIGHTS)
/*else if (maptol & TOL_NIGHTS)
{
if (!player->capsule && !player->bonustime)
{
@ -6585,15 +6567,15 @@ static void P_MovePlayer(player_t *player)
P_DamageMobj(player->mo, NULL, NULL, 1);
player->pflags &= ~PF_NIGHTSFALL;
}
}
}*/
//////////////////////
// MOVEMENT CODE //
//////////////////////
if (twodlevel || player->mo->flags2 & MF2_TWOD) // 2d-level, so special control applies.
/*if (twodlevel || player->mo->flags2 & MF2_TWOD) // 2d-level, so special control applies.
P_2dMovement(player);
else
else*/
{
if (!player->climbing && (!P_AnalogMove(player)))
player->mo->angle = (cmd->angleturn<<16 /* not FRACBITS */);
@ -9441,8 +9423,8 @@ void P_PlayerThink(player_t *player)
player->losstime--;
// Flash player after being hit.
if (!(player->pflags & PF_NIGHTSMODE
|| player->kartstuff[k_hyudorotimer] // SRB2kart - fixes Hyudoro not flashing when it should.
if (!(//player->pflags & PF_NIGHTSMODE ||
player->kartstuff[k_hyudorotimer] // SRB2kart - fixes Hyudoro not flashing when it should.
|| player->kartstuff[k_growshrinktimer] > 0 // Grow doesn't flash either.
|| player->kartstuff[k_respawn] // Respawn timer (for drop dash effect)
|| (G_BattleGametype() && player->kartstuff[k_bumper] <= 0 && player->kartstuff[k_comebacktimer])
@ -9454,13 +9436,13 @@ void P_PlayerThink(player_t *player)
else
player->mo->flags2 &= ~MF2_DONTDRAW;
}
else if (player->mo->tracer)
/*else if (player->mo->tracer)
{
if (player->powers[pw_flashing] & 1)
player->mo->tracer->flags2 |= MF2_DONTDRAW;
else
player->mo->tracer->flags2 &= ~MF2_DONTDRAW;
}
}*/
player->pflags &= ~PF_SLIDING;

View File

@ -560,13 +560,13 @@ void Y_Ticker(void)
// Team scramble code for team match and CTF.
// Don't do this if we're going to automatically scramble teams next round.
if (G_GametypeHasTeams() && cv_teamscramble.value && !cv_scrambleonchange.value && server)
/*if (G_GametypeHasTeams() && cv_teamscramble.value && !cv_scrambleonchange.value && server)
{
// If we run out of time in intermission, the beauty is that
// the P_Ticker() team scramble code will pick it up.
if ((intertic % (TICRATE/7)) == 0)
P_DoTeamscrambling();
}
}*/
// multiplayer uses timer (based on cv_inttime)
if (timer)