Compare commits

..
16 Commits
Author SHA1 Message Date
alufolie91 029c21eae8 correct map issues clientside
but be loud about it instead of I_Error´ing
most of those would be fatal anyways, so screw vanilla desyncing if they crash eitherways
2026-06-22 20:53:49 +02:00
entryway 568f29ed1c Check for blockmap overflow in P_BlockLinesIterator. Under RANGECHECK define. 2026-06-22 20:52:49 +02:00
alufolie91 2dacc333b5 just set backsector to NULL
if not in vanilla doom compat mode/overflow emulation GetSectorAtNullAddress will just return NULL, so we can do so aswell
2026-06-22 20:52:42 +02:00
alufolie91 363612c488 port more checks from dsda-doom for invalid map data
decided to have it i_error for now, not sure what exactly is the best approach here
should we just "correct" some of those instead?
vanilla probably just crashes anyways
2026-06-22 20:52:19 +02:00
alufolie91 d8ffffd86e replace non valid sidenum magic number
with what dsda-doom uses
2026-06-22 20:52:11 +02:00
alufolie91 4b2a13defb cleanup K_DropItems a bit
move "paperitem" spawn to its separate function like RR
2026-06-21 23:30:20 +02:00
alufolie91 9cc74d8b17 use P_MobjWasRemoved for P_MoveChaseCamera
dont need to care about synch safety here....
2026-06-21 23:07:20 +02:00
alufolie91 066adb972e add some more mobj null checks to P_MobjThinker
from srb2 ig
2026-06-21 23:07:17 +02:00
alufolie91 0f1ad8a086 few more smaller cleanups 2026-06-21 23:07:12 +02:00
alufolie91 40537eca81 cleanup P_KillMobj a little 2026-06-21 23:03:45 +02:00
AJ Martinez 0cff3c23f3 Don't attempt itemamount correction after orbitals self-destruct 2026-06-21 22:35:20 +02:00
alufolie91 9bdda66a0c rename this to D_CheckMapReplacements 2026-06-21 19:14:22 +02:00
alufolie91 3b6a09da9b oops 2026-06-21 19:04:48 +02:00
Zwip-Zwap Zapony c275555678 Draw the input prompt while the console is moving 2026-06-21 19:00:10 +02:00
Zwip-Zwap Zapony fc588f8046 Make con_height adjustable on the fly 2026-06-21 19:00:07 +02:00
alufolie91 17093e8022 add command to list unused map slots
less pain for server owners
hope this is sufficient
2026-06-21 18:03:50 +02:00
17 changed files with 259 additions and 194 deletions

No files matched your search

+53 -39
View File
@@ -62,7 +62,7 @@ static boolean con_started = false; // console has been initialised
static boolean con_forcepic = true; // at startup toggle console translucency when first off
boolean con_recalc = false; // set true when screen size has changed
static tic_t con_tick; // console ticker for anim or blinking prompt cursor
static tic_t con_tick; // console ticker for blinking prompt cursor
// con_scrollup should use time (currenttime - lasttime)..
static boolean consoletoggle; // true when console key pushed, ticker will handle
@@ -103,6 +103,7 @@ static void CON_InputInit(void);
static void CON_RecalcSize(void);
static void CON_ChangeHeight(void);
static void CONS_height_Change(void);
static void CONS_hudlines_Change(void);
static void CONS_backcolor_Change(void);
@@ -131,7 +132,7 @@ static CV_PossibleValue_t speed_cons_t[] = {{0, "MIN"}, {64, "MAX"}, {0, NULL}};
static consvar_t cons_speed = {"con_speed", "8", CV_SAVE, speed_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
// percentage of screen height to use for console
static consvar_t cons_height = {"con_height", "50", CV_SAVE, CV_Unsigned, NULL, 0, NULL, NULL, 0, 0, NULL};
static consvar_t cons_height = {"con_height", "50", CV_CALL|CV_SAVE, CV_Unsigned, CONS_height_Change, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t backpic_cons_t[] = {{0, "translucent"}, {1, "picture"}, {0, NULL}};
// whether to use console background picture, or translucent mode
@@ -173,6 +174,18 @@ consvar_t cons_consoleprintinmenu = {"consoleprintinmenu", "Off", CV_SAVE, CV_On
static void CON_Print(char *msg);
// Change the console height on demand
//
static void CONS_height_Change(void)
{
Lock_state();
if (con_destlines > 0 && !con_startup) // If the console is open (as in, not using "bind")...
CON_ChangeHeight(); // ...update its height now, not only when it's closed and re-opened
Unlock_state();
}
//
//
static void CONS_hudlines_Change(void)
@@ -1637,53 +1650,54 @@ static void CON_DrawConsole(void)
}
// draw console text lines from top to bottom
if (con_curlines < minheight)
return;
i = con_cy - con_scrollup;
// skip the last empty line due to the cursor being at the start of a new line
i--;
i -= (con_curlines - minheight) / charheight;
if (rendermode == render_none) return;
for (y = (con_curlines-minheight) % charheight; y <= con_curlines-minheight; y += charheight, i++)
if (con_curlines >= minheight)
{
INT32 x;
size_t c;
i = con_cy - con_scrollup;
p = (UINT8 *)&con_buffer[((i > 0 ? i : 0)%con_totallines)*con_width];
// skip the last empty line due to the cursor being at the start of a new line
i--;
for (c = 0, x = charwidth; c < con_width; c++, x += charwidth, p++)
i -= (con_curlines - minheight) / charheight;
if (rendermode == render_none)
return;
for (y = (con_curlines-minheight) % charheight; y <= con_curlines-minheight; y += charheight, i++)
{
while (*p & 0x80)
INT32 x;
size_t c;
p = (UINT8 *)&con_buffer[((i > 0 ? i : 0)%con_totallines)*con_width];
for (c = 0, x = charwidth; c < con_width; c++, x += charwidth, p++)
{
charflags = (*p & 0x7f) << V_CHARCOLORSHIFT;
p++;
c++;
while (*p & 0x80)
{
charflags = (*p & 0x7f) << V_CHARCOLORSHIFT;
p++;
c++;
}
if (c >= con_width)
break;
int emotelen;
emote_t *emote;
if ((emote = M_VerifyEmote((const char *)p, &emotelen)))
{
M_DrawScaledEmote(x<<FRACBITS, (y+2*con_scalefactor)<<FRACBITS, charwidth*FRACUNIT/EMOTEWIDTH, emote, V_NOSCALESTART|V_NOSCALEPATCH);
p += emotelen-1;
c += emotelen-1;
continue;
}
V_DrawCharacter(x, y, (INT32)(*p) | charflags | cv_constextsize.value | V_NOSCALESTART, !cv_allcaps.value);
}
if (c >= con_width)
break;
int emotelen;
emote_t *emote;
if ((emote = M_VerifyEmote((const char *)p, &emotelen)))
{
M_DrawScaledEmote(x<<FRACBITS, (y+2*con_scalefactor)<<FRACBITS, charwidth*FRACUNIT/EMOTEWIDTH, emote, V_NOSCALESTART|V_NOSCALEPATCH);
p += emotelen-1;
c += emotelen-1;
continue;
}
V_DrawCharacter(x, y, (INT32)(*p) | charflags | cv_constextsize.value | V_NOSCALESTART, !cv_allcaps.value);
}
}
// draw prompt if enough place (not while game startup)
if ((con_curlines == con_destlines) && (con_curlines >= minheight) && !con_startup)
if ((con_curlines >= (minheight-charheight)) && !con_startup)
CON_DrawInput();
}
+10 -8
View File
@@ -1353,7 +1353,7 @@ static void IdentifyVersion(void)
//
// search for maps
//
static void D_CheckMaps(boolean checkreplaced)
static void D_CheckMapReplacements(boolean checkreplaced)
{
INT32 i;
char *name;
@@ -1829,17 +1829,19 @@ void D_SRB2Main(void)
// conversion sometimes needs the palette
V_ReloadPalette();
D_CheckMaps(false);
D_CheckMapReplacements(false);
W_InitMultipleFiles(startuppwads, startuppwadcount, true);
// Only search for pwad maps if we actually have a pwad added
if (startuppwadcount > 0)
{
D_CheckMaps(true);
CONS_Printf("W_InitMultipleFiles(): Adding extra PWADs.\n");
W_InitMultipleFiles(startuppwads, startuppwadcount, true);
// Only search for pwad maps if we actually have a pwad added
D_CheckMapReplacements(true);
D_CleanFile(startuppwads, startuppwadcount);
}
D_CleanFile(startuppwads, startuppwadcount);
startuppwadcount = 0;
cht_Init();
@@ -1926,7 +1928,7 @@ void D_SRB2Main(void)
CONS_Printf("R_Init(): Init SRB2 refresh daemon.\n");
R_Init();
#if SOUND==SOUND_DUMMY
#if SOUND == SOUND_DUMMY
sound_disabled = true;
music_disabled = true;
#else
+19
View File
@@ -150,6 +150,7 @@ static void Command_ListWADS_f(void);
static void Command_LocateLump_f(void);
static void Command_ListDoomednums_f(void);
static void Command_ListUnusedSprites_f(void);
static void Command_ListUnusedMapSlots_f(void);
static void Command_RunSOC(void);
static void Command_Pause(void);
static void Command_Respawn(void);
@@ -645,6 +646,7 @@ void D_RegisterServerCommands(void)
COM_AddCommand("locatelump", Command_LocateLump_f);
COM_AddCommand("listmapthings", Command_ListDoomednums_f);
COM_AddCommand("listunusedsprites", Command_ListUnusedSprites_f);
COM_AddCommand("listunusedmapslots", Command_ListUnusedMapSlots_f);
COM_AddCommand("runsoc", Command_RunSOC);
COM_AddCommand("pause", Command_Pause);
@@ -4591,6 +4593,23 @@ void Command_ListUnusedSprites_f(void)
}
}
void Command_ListUnusedMapSlots_f(void)
{
INT32 i;
CONS_Printf("\x82Printing map slot non-usage...\n");
for (i = 0; i < NUMMAPS; i++)
{
// is checking this enough?
if (mapheaderinfo[i])
continue;
CONS_Printf("%s\n", G_BuildMapName(i+1));
}
}
// =========================================================================
// MISC. COMMANDS
// =========================================================================
-11
View File
@@ -602,9 +602,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
// None of these that are disabled in the normal build are guaranteed to work perfectly
// Compile them at your own risk!
// undefine to enable fixes and features that are not vanilla compatible
#define COMPAT_VANILLA
//-- SATURN __
/// Detect if a client is on Saturn in the clientconfig.
/// To seperately allow them to join or block joining from vanilla clients.
@@ -669,14 +666,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
#undef UPDATE_ALERT
#endif
// overwrite some of those
// when not compiling in vanilla compat mode
#ifndef COMPAT_VANILLA
#define SATURNJOIN
#define SATURNPAK
#undef SEENAMES
#endif
#ifdef __cplusplus
} // extern "C"
#endif
+3 -2
View File
@@ -857,7 +857,8 @@ static void G_HandleLocalDriftturn(ticcmd_t *cmd, UINT8 ssplayer)
static void G_BuildLocalTiccmd(ticcmd_t *cmd, UINT8 ssplayer, boolean freecam)
{
INT32 axis = 0;
const boolean usejoystick = cv_usejoystick[(ssplayer-1)].value;
const UINT8 forplayer = (ssplayer-1);
const boolean usejoystick = cv_usejoystick[forplayer].value;
// check for inputs and return button commands
// for stuff like joining with item button, saltyhop, honking, etc.
@@ -893,7 +894,7 @@ static void G_BuildLocalTiccmd(ticcmd_t *cmd, UINT8 ssplayer, boolean freecam)
#undef CHECKINPUT
axis = JoyAxis(AXISLOOKBACK, ssplayer);
camspin[ssplayer-1] = (InputDown(gc_lookback, ssplayer) || (usejoystick && axis > 0));
camspin[forplayer] = (InputDown(gc_lookback, ssplayer) || (usejoystick && axis > 0));
// Reset to our spec player if we watch someone else.
if ((cmd->driftturn || cmd->buttons)
+1
View File
@@ -1135,6 +1135,7 @@ static void HU_SendChatMessage(void)
return;
}
}
// I'm very bad at C, I swear I am, additional checks eww!
if (spc != 0)
{
+46 -35
View File
@@ -4559,50 +4559,59 @@ void K_DropHnextList(player_t *player)
P_RemoveMobj(work);
}
{
// we need this here too because this is done in afterthink - pointers are cleaned up at the START of each tic...
P_SetTarget(&player->mo->hnext, NULL);
player->kartstuff[k_bananadrag] = 0;
// we need this here too because this is done in afterthink - pointers are cleaned up at the START of each tic...
P_SetTarget(&player->mo->hnext, NULL);
player->kartstuff[k_bananadrag] = 0;
if (player->kartstuff[k_eggmanheld])
player->kartstuff[k_eggmanheld] = 0;
else if (player->kartstuff[k_itemheld]
&& (dropall || (--player->kartstuff[k_itemamount] <= 0)))
{
player->kartstuff[k_itemamount] = player->kartstuff[k_itemheld] = 0;
player->kartstuff[k_itemtype] = KITEM_NONE;
}
if (player->kartstuff[k_eggmanheld])
player->kartstuff[k_eggmanheld] = 0;
else if (player->kartstuff[k_itemheld]
&& (dropall || (--player->kartstuff[k_itemamount] <= 0)))
{
player->kartstuff[k_itemamount] = player->kartstuff[k_itemheld] = 0;
player->kartstuff[k_itemtype] = KITEM_NONE;
}
}
static void K_DropPaperItem(player_t *player, boolean thunderhack, INT32 itemamount)
{
const mobj_t *pmo = player->mo;
if (P_MobjWasRemoved(pmo))
{
return;
}
mobj_t *drop = P_SpawnMobj(pmo->x, pmo->y, (pmo->z + pmo->height/2), MT_FLOATINGITEM);
P_SetScale(drop, drop->scale>>4);
drop->destscale = (3*drop->destscale)/2;
drop->angle = pmo->angle + ANGLE_90;
P_Thrust(drop, FixedAngle(P_RandomFixed()*180) + pmo->angle + ANGLE_90, 16*mapobjectscale);
drop->momz = P_MobjFlip(pmo)*3*mapobjectscale;
if (drop->eflags & MFE_UNDERWATER)
drop->momz = (117 * drop->momz) / 200;
drop->threshold = (thunderhack ? KITEM_THUNDERSHIELD : player->kartstuff[k_itemtype]);
drop->movecount = itemamount;
drop->flags |= MF_NOCLIPTHING;
}
// For getting EXTRA hit!
void K_DropItems(player_t *player)
{
boolean thunderhack = (player->kartstuff[k_curshield] && player->kartstuff[k_itemtype] == KITEM_THUNDERSHIELD);
const boolean thunderhack = (player->kartstuff[k_curshield] && player->kartstuff[k_itemtype] == KITEM_THUNDERSHIELD);
if (thunderhack)
player->kartstuff[k_itemtype] = KITEM_NONE;
K_DropHnextList(player);
if (!P_MobjWasRemoved(player->mo) && player->kartstuff[k_itemamount])
if (player->kartstuff[k_itemamount])
{
mobj_t *drop = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z + player->mo->height/2, MT_FLOATINGITEM);
P_SetScale(drop, drop->scale>>4);
drop->destscale = (3*drop->destscale)/2;
drop->angle = player->mo->angle + ANGLE_90;
P_Thrust(drop,
FixedAngle(P_RandomFixed()*180) + player->mo->angle + ANGLE_90,
16*mapobjectscale);
drop->momz = P_MobjFlip(player->mo)*3*mapobjectscale;
if (drop->eflags & MFE_UNDERWATER)
drop->momz = (117 * drop->momz) / 200;
drop->threshold = (thunderhack ? KITEM_THUNDERSHIELD : player->kartstuff[k_itemtype]);
drop->movecount = player->kartstuff[k_itemamount];
drop->flags |= MF_NOCLIPTHING;
K_DropPaperItem(player, thunderhack, player->kartstuff[k_itemamount]);
}
K_StripItems(player);
@@ -4658,7 +4667,7 @@ void K_DropKitchenSink(player_t *player)
return;
if (player->mo->hnext->type != MT_SINK_SHIELD)
return; //so we can just call this function regardless of what is being held
return; // so we can just call this function regardless of what is being held
P_KillMobj(player->mo->hnext, NULL, NULL);
@@ -4684,9 +4693,8 @@ void K_RepairOrbitChain(mobj_t *orbit)
}
// Then recount to make sure item amount is correct
if (orbit->target && orbit->target->player)
if (orbit->target && orbit->target->player) // !P_MobjWasRemoved(orbit->target)
{
player_t *player = orbit->target->player;
INT32 num = 0;
mobj_t *cur = orbit->target->hnext;
@@ -4696,13 +4704,14 @@ void K_RepairOrbitChain(mobj_t *orbit)
{
prev = cur;
cur = cur->hnext;
if (++num > player->kartstuff[k_itemamount])
if (++num > orbit->target->player->kartstuff[k_itemamount])
P_RemoveMobj(prev);
else
prev->movedir = num;
}
player->kartstuff[k_itemamount] = num;
if (orbit->target) // !P_MobjWasRemoved(orbit->target)
orbit->target->player->kartstuff[k_itemamount] = num;
}
}
@@ -4934,8 +4943,10 @@ static void K_MoveHeldObjects(player_t *player)
cur->momx = FixedMul(FINECOSINE(cur->angle>>ANGLETOFINESHIFT), cur->extravalue1);
cur->momy = FixedMul(FINESINE(cur->angle>>ANGLETOFINESHIFT), cur->extravalue1);
cur->flags &= ~MF_NOCLIPTHING;
if (!P_TryMove(cur, player->mo->x + cur->momx, player->mo->y + cur->momy, true))
P_SlideMove(cur, true);
if (P_IsObjectOnGround(player->mo))
{
if (P_MobjFlip(cur) > 0)
+82 -66
View File
@@ -1462,48 +1462,11 @@ boolean P_CheckRacers(void)
return false;
}
/** Kills an object.
*
* \param target The victim.
* \param inflictor The attack weapon. May be NULL (environmental damage).
* \param source The attacker. May be NULL.
* \todo Cleanup, refactor, split up.
* \sa P_DamageMobj
*/
void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
static void P_UpdateRemovedOrbital(mobj_t *target, mobj_t *inflictor, mobj_t *source)
{
mobjtype_t item;
mobj_t *mo;
int ms;
if (target->flags & (MF_ENEMY|MF_BOSS))
target->momx = target->momy = target->momz = 0;
// SRB2kart
if (target->type != MT_PLAYER && !(target->flags & MF_MONITOR)
&& !(target->type == MT_ORBINAUT || target->type == MT_ORBINAUT_SHIELD
|| target->type == MT_JAWZ || target->type == MT_JAWZ_DUD || target->type == MT_JAWZ_SHIELD
|| target->type == MT_BANANA || target->type == MT_BANANA_SHIELD
|| target->type == MT_EGGMANITEM || target->type == MT_EGGMANITEM_SHIELD
|| target->type == MT_BALLHOG || target->type == MT_SPB)) // kart dead items
target->flags |= MF_NOGRAVITY; // Don't drop Tails 03-08-2000
else
target->flags &= ~MF_NOGRAVITY; // lose it if you for whatever reason have it, I'm looking at you shields
//
if (target->flags2 & MF2_NIGHTSPULL)
P_SetTarget(&target->tracer, NULL);
// dead target is no more shootable
target->flags &= ~(MF_SHOOTABLE|MF_FLOAT|MF_SPECIAL);
target->flags2 &= ~(MF2_SKULLFLY|MF2_NIGHTSPULL);
target->health = 0; // This makes it easy to check if something's dead elsewhere.
if (LUA_HookMobjDeath(target, inflictor, source) || P_MobjWasRemoved(target))
return;
// SRB2kart
// I wish I knew a better way to do this
//if (!P_MobjWasRemoved(target->target) && target->target->player && !P_MobjWasRemoved(target->target->player->mo))
if (target->target && target->target->player && target->target->player->mo)
{
if (target->target->player->kartstuff[k_eggmanheld] && target->type == MT_EGGMANITEM_SHIELD)
@@ -1517,7 +1480,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
{
if (target->movedir != 0 && target->movedir < (UINT16)target->target->player->kartstuff[k_itemamount])
{
if (target->target->hnext)
if (target->target->hnext) // !P_MobjWasRemoved(target->target->hnext))
K_KillBananaChain(target->target->hnext, inflictor, source);
target->target->player->kartstuff[k_itemamount] = 0;
@@ -1546,14 +1509,60 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
P_SetTarget(&target->target->hnext, NULL);
}
}
// Above block does not clean up rocket sneakers when a player dies, so we need to do it here target->target is null when using rocket sneakers
}
/** Kills an object.
*
* \param target The victim.
* \param inflictor The attack weapon. May be NULL (environmental damage).
* \param source The attacker. May be NULL.
* \todo Cleanup, refactor, split up.
* \sa P_DamageMobj
*/
void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
{
mobjtype_t item;
mobj_t *mo;
int ms;
if (target->flags & (MF_ENEMY|MF_BOSS))
target->momx = target->momy = target->momz = 0;
// SRB2kart
if (target->type != MT_PLAYER
&& !(target->flags & MF_MONITOR)
&& !(target->type == MT_ORBINAUT || target->type == MT_ORBINAUT_SHIELD
|| target->type == MT_JAWZ || target->type == MT_JAWZ_DUD || target->type == MT_JAWZ_SHIELD
|| target->type == MT_BANANA || target->type == MT_BANANA_SHIELD
|| target->type == MT_EGGMANITEM || target->type == MT_EGGMANITEM_SHIELD
|| target->type == MT_BALLHOG || target->type == MT_SPB)) // kart dead items
target->flags |= MF_NOGRAVITY; // Don't drop Tails 03-08-2000
else
target->flags &= ~MF_NOGRAVITY; // lose it if you for whatever reason have it, I'm looking at you shields
//
if (target->flags2 & MF2_NIGHTSPULL)
P_SetTarget(&target->tracer, NULL);
// dead target is no more shootable
target->flags &= ~(MF_SHOOTABLE|MF_FLOAT|MF_SPECIAL);
target->flags2 &= ~(MF2_SKULLFLY|MF2_NIGHTSPULL);
target->health = 0; // This makes it easy to check if something's dead elsewhere.
if (LUA_HookMobjDeath(target, inflictor, source) || P_MobjWasRemoved(target))
return;
P_UpdateRemovedOrbital(target, inflictor, source);
if (target->player)
{
// Above block does not clean up rocket sneakers when a player dies, so we need to do it here target->target is null when using rocket sneakers
K_DropRocketSneaker(target->player);
// Let EVERYONE know what happened to a player! 01-29-2002 Tails
if (target->player && !target->player->spectator)
{
target->flags2 &= ~MF2_DONTDRAW;
// Let EVERYONE know what happened to a player! 01-29-2002 Tails
if (!target->player->spectator)
target->flags2 &= ~MF2_DONTDRAW;
}
// if killed by a player
@@ -1563,6 +1572,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
{
P_SetTarget(&target->target, source);
source->player->numboxes++;
if (cv_itemrespawn.value && (netgame || multiplayer))
{
target->fuse = cv_itemrespawntime.value*TICRATE + 2; // Random box generation
@@ -1580,35 +1590,41 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
target->player->playerstate = PST_DEAD;
if (cv_fading.value && P_IsLocalPlayer(target->player))
if (P_IsLocalPlayer(target->player))
{
if (netgame || multiplayer)
ms = cv_respawntime.value * 1000;
else
ms = 1000;
if (cv_fading.value)
{
if (netgame || multiplayer)
ms = cv_respawntime.value * 1000;
else
ms = 1000;
/*
If the time spent with the music paused is less than half
a second, continue playing the song (just mute it).
*/
if ((ms - cv_respawnfademusicout.value) < 500)
S_FadeMusic(0, cv_respawnfademusicout.value);
else
S_FadeOutStopMusic(cv_respawnfademusicout.value);
}
/*
* If the time spent with the music paused is less than half
* a second, continue playing the song (just mute it).
*/
if ((ms - cv_respawnfademusicout.value) < 500)
S_FadeMusic(0, cv_respawnfademusicout.value);
else
S_FadeOutStopMusic(cv_respawnfademusicout.value);
}
for (UINT8 i = 0; i <= splitscreen; i++)
{
if (target->player == P_GetLocalPlayerForNum(i))
if (target->player == &players[consoleplayer])
{
// don't die in auto map,
// switch view prior to dying
if (i == 0 && automapactive)
if (automapactive)
AM_Stop();
}
// added : 22-02-98: recenter view for next life...
localaiming[i] = 0;
break;
for (UINT8 i = 0; i <= splitscreen; i++)
{
if (target->player == P_GetLocalPlayerForNum(i))
{
// added : 22-02-98: recenter view for next life...
localaiming[i] = 0;
break;
}
}
}
+2 -2
View File
@@ -1575,13 +1575,13 @@ static boolean PIT_CheckLine(line_t *ld)
tmbbox[BOXLEFT] >= ld->bbox[BOXRIGHT] ||
tmbbox[BOXTOP] <= ld->bbox[BOXBOTTOM] ||
tmbbox[BOXBOTTOM] >= ld->bbox[BOXTOP])
return true;
return true; // didn't hit it
if (ld->polyobj && !(ld->polyobj->flags & POF_SOLID))
return true;
if (P_BoxOnLineSide(tmbbox, ld) != -1)
return true;
return true; // didn't hit it
if (tmthing->flags & MF_PAPERCOLLISION) // Caution! Turning whilst up against a wall will get you stuck. You probably shouldn't give the player this flag.
{
+3
View File
@@ -1004,11 +1004,13 @@ boolean P_BlockThingsIterator(INT32 x, INT32 y, boolean (*func)(mobj_t *))
for (mobj = blocklinks[y*bmapwidth + x]; mobj; mobj = bnext)
{
P_SetTarget(&bnext, mobj->bnext); // We want to note our reference to bnext here incase it is MF_NOTHINK and gets removed!
if (!func(mobj))
{
P_SetTarget(&bnext, NULL);
return false;
}
if (P_MobjWasRemoved(tmthing) // func just popped our tmthing, cannot continue.
|| (bnext && P_MobjWasRemoved(bnext))) // func just broke blockmap chain, cannot continue.
{
@@ -1016,6 +1018,7 @@ boolean P_BlockThingsIterator(INT32 x, INT32 y, boolean (*func)(mobj_t *))
return true;
}
}
P_SetTarget(&bnext, NULL);
return true;
}
+9 -8
View File
@@ -9167,6 +9167,11 @@ void P_MobjThinker(mobj_t *mobj)
|| P_WeaponOrPanel(mobj->type))
{
P_TryMove(mobj, mobj->x, mobj->y, true); // Sets mo->standingslope correctly
//if (P_MobjWasRemoved(mobj))
if (!mobj) // anything that calls checkposition can be lethal
return;
P_ButteredSlope(mobj);
}
@@ -9192,6 +9197,10 @@ void P_MobjThinker(mobj_t *mobj)
}
}
//if (P_MobjWasRemoved(mobj))
if (!mobj)
return; // obligatory paranoia check
// Can end up here if a player dies.
P_CycleMobjState(mobj);
@@ -11029,11 +11038,7 @@ void P_SpawnMapThing(mapthing_t *mthing)
{
if (mthing->type > MAXPLAYERS) // be wary of playerstarts size! playerstarts[MAXPLAYERS]
{
#ifdef COMPAT_VANILLA
CONS_Alert(CONS_ERROR, "Excess player start detected %d This will crash vanilla clients!\n", mthing->type);
#else
CONS_Debug(DBG_SETUP, "Excess player start detected %d\n", mthing->type);
#endif
}
else
{
@@ -11284,11 +11289,7 @@ void P_SpawnMapThing(mapthing_t *mthing)
if (P_MobjWasRemoved(mobj))
{
#ifdef COMPAT_VANILLA
CONS_Alert(CONS_ERROR, "Failed to spawn map thing #%d at %d, %d. This will crash vanilla clients!\n", mthing->type, x>>FRACBITS, y>>FRACBITS);
#else
CONS_Debug(DBG_SETUP, "Failed to spawn map thing #%d at %d, %d.\n", mthing->type, x>>FRACBITS, y>>FRACBITS);
#endif
return;
}
+11 -5
View File
@@ -1178,6 +1178,7 @@ static void P_InitializeLinedef(line_t *ld)
CONS_Debug(DBG_SETUP, "P_InitializeLinedef: Linedef %s has two-sided flag set, but no second sidedef\n", sizeu1((size_t)(ld - lines)));
}
// killough 4/4/98: support special sidedef interpretation below
if (ld->sidenum[0] != NO_INDEX && ld->special)
sides[ld->sidenum[0]].special = ld->special;
if (ld->sidenum[1] != NO_INDEX && ld->special)
@@ -2495,7 +2496,9 @@ static void P_LoadRecordGhosts(void)
if (!gpath)
return;
sprintf(gpath,"%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s", srb2home, timeattackfolder, G_BuildMapName(gamemap));
const char *mapname = G_BuildMapName(gamemap);
sprintf(gpath,"%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s", srb2home, timeattackfolder, mapname);
// Best Time ghost
if (cv_ghost_besttime.value)
@@ -2545,9 +2548,10 @@ static void P_LoadRecordGhosts(void)
{
lumpnum_t l;
UINT8 j = 1;
while (j <= 99 && (l = W_CheckNumForName(va("%sS%02u",G_BuildMapName(gamemap),j))) != LUMPERROR)
while (j <= 99 && (l = W_CheckNumForName(va("%sS%02u", mapname, j))) != LUMPERROR)
{
G_AddGhost(va("%sS%02u",G_BuildMapName(gamemap),j));
G_AddGhost(va("%sS%02u", mapname, j));
j++;
}
}
@@ -2589,10 +2593,12 @@ static void P_InitMinimapInfo(void)
Patch_Free(minimapinfo.minimap_pic);
minimapinfo.minimap_pic = NULL;
lumpnum = W_CheckNumForName(va("%sR", G_BuildMapName(gamemap)));
const char *mapname = G_BuildMapName(gamemap);
lumpnum = W_CheckNumForName(va("%sR", mapname));
if (lumpnum != LUMPERROR)
minimapinfo.minimap_pic = W_CachePatchName(va("%sR", G_BuildMapName(gamemap)), PU_PATCH);
minimapinfo.minimap_pic = W_CachePatchName(va("%sR", mapname), PU_PATCH);
minimapinfo.min_x = bsp->bbox[0][BOXLEFT];
minimapinfo.max_x = bsp->bbox[0][BOXRIGHT];
-2
View File
@@ -4609,13 +4609,11 @@ void P_UpdateSpecials(void)
// POINT LIMIT
P_CheckPointLimit();
#ifdef COMPAT_VANILLA
// Dynamic slopeness
// we run this here only when not joined midrace
// for vanilla compat reasons :chaosleep:
if (!midgamejoin)
P_RunDynamicSlopes();
#endif
P_UpdateAnimFlats();
}
-2
View File
@@ -646,9 +646,7 @@ void P_Ticker(boolean run)
if (run)
{
// Dynamic slopeness
#ifdef COMPAT_VANILLA
if (midgamejoin) // only run here if we joined midgame to fix some desynchs
#endif
P_RunDynamicSlopes();
PS_START_TIMING(ps_thinkertime);
+1 -1
View File
@@ -3739,7 +3739,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
fixed_t f1, f2;
// We probably shouldn't move the camera if there is no player or player mobj somehow
if (!player || !player->mo)
if (!player || P_MobjWasRemoved(player->mo))
return true;
// This can happen when joining
+18 -13
View File
@@ -311,6 +311,7 @@ static void R_RenderMaskedSegLoop(drawcolumndata_t* dc, drawseg_t *drawseg, INT3
{
rw_scalestep = drawseg->scalestep;
spryscale = drawseg->scale1 + (x1 - drawseg->x1)*rw_scalestep;
if (dc->numlights)
{ // reset all lights to their starting heights
for (i = 0; i < dc->numlights; i++)
@@ -435,6 +436,7 @@ static void R_RenderMaskedSegLoop(drawcolumndata_t* dc, drawseg_t *drawseg, INT3
windowtop = windowbottom + 1;
set_colormap_below_light();
}
windowbottom = realbot;
if (windowtop < windowbottom)
colfunc_2s(dc, col);
@@ -2615,8 +2617,8 @@ void R_StoreWallRange(INT32 start, INT32 stop)
auto set_topstep_normal = [&]
{
topstep = -FixedMul (rw_scalestep, worldtop);
topfrac = (centeryfrac>>4) - FixedMul (worldtop, rw_scale);
topstep = -FixedMul(rw_scalestep, worldtop);
topfrac = (centeryfrac>>4) - FixedMul(worldtop, rw_scale);
};
// untextured seg
@@ -2625,7 +2627,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
const bool tophigh = (worldhigh <= worldtop && worldhighslope <= worldtopslope);
// if we cant see the goddamn skyplane, well there wont be any skybox
// we could kill skyVisible instead, but i want to keep the performance improvemnts it yields
// we could kill skyVisible instead, but i want to keep the performance improvements it yields
// so we do this absolute trash
if ((tophigh
&& (frontsector->floorpic != skyflatnum && frontsector->ceilingpic != skyflatnum)) // try to guess if its a "window"
@@ -2637,14 +2639,16 @@ void R_StoreWallRange(INT32 start, INT32 stop)
// this is an attempt to fix issues with textureless single sided lines drawing nothing where they should just draw sky instead
if (tophigh && !backsector && frontsector->ceilingpic == skyflatnum)
{
topstep = -FixedMul (rw_scalestep, worldbottom);
topfrac = (centeryfrac>>4) - FixedMul (worldbottom, rw_scale);
// account for slopes to try and get rid of sharp edges from the black void
if (frontsector->f_slope || (backsector && backsector->f_slope))
{
topstep = -FixedMul (rw_scalestep, worldbottomslope);
topfrac = (centeryfrac>>4) - FixedMul (worldbottomslope, rw_scale);
topstep = -FixedMul(rw_scalestep, worldbottomslope);
topfrac = (centeryfrac>>4) - FixedMul(worldbottomslope, rw_scale);
}
else
{
topstep = -FixedMul(rw_scalestep, worldbottom);
topfrac = (centeryfrac>>4) - FixedMul(worldbottom, rw_scale);
}
}
else
@@ -2653,18 +2657,18 @@ void R_StoreWallRange(INT32 start, INT32 stop)
else
set_topstep_normal();
bottomstep = -FixedMul (rw_scalestep, worldbottom);
bottomfrac = (centeryfrac>>4) - FixedMul (worldbottom, rw_scale);
bottomstep = -FixedMul(rw_scalestep, worldbottom);
bottomfrac = (centeryfrac>>4) - FixedMul(worldbottom, rw_scale);
if (frontsector->c_slope)
{
fixed_t topfracend = (centeryfrac>>4) - FixedMul (worldtopslope, ds_p->scale2);
fixed_t topfracend = (centeryfrac>>4) - FixedMul(worldtopslope, ds_p->scale2);
topstep = (topfracend-topfrac)/(range);
}
if (frontsector->f_slope)
{
fixed_t bottomfracend = (centeryfrac>>4) - FixedMul (worldbottomslope, ds_p->scale2);
fixed_t bottomfracend = (centeryfrac>>4) - FixedMul(worldbottomslope, ds_p->scale2);
bottomstep = (bottomfracend-bottomfrac)/(range);
}
}
@@ -2782,7 +2786,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
if (bottomtexture)
{
fixed_t bottomfracend = (centeryfrac>>4) - FixedMul (worldlowslope, ds_p->scale2);
fixed_t bottomfracend = (centeryfrac>>4) - FixedMul(worldlowslope, ds_p->scale2);
pixlow = (centeryfrac>>4) - FixedMul (worldlow, rw_scale);
pixlowstep = (bottomfracend-pixlow)/(range);
@@ -3045,6 +3049,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
ds_p->silhouette |= SIL_BOTTOM;
ds_p->bsilheight = backsector->f_slope ? INT32_MAX : backsector->floorheight;
}
if (!(ds_p->silhouette & SIL_TOP))
{
ds_p->silhouette |= SIL_TOP;
+1
View File
@@ -937,6 +937,7 @@ static boolean S_AdjustSoundParams(const mobj_t *listener, const mobj_t *source,
listener_t listensource;
INT32 i;
// e6y
if (!listener)
return false;