Compare commits

..
6 Commits
Author SHA1 Message Date
alufolie91 36d1f59114 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:50:32 +02:00
entryway 99d49adad5 Check for blockmap overflow in P_BlockLinesIterator. Under RANGECHECK define. 2026-06-20 18:55:01 +02:00
alufolie91 6267e1a062 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-19 19:08:14 +02:00
alufolie91 051bb528a6 add flag "COMPAT_VANILLA"
undefine to enable features that are not vanilla compatible
2026-06-19 19:08:11 +02:00
alufolie91 a95c9bf6ee 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-19 16:54:58 +02:00
alufolie91 d74ebda83e replace non valid sidenum magic number
with what dsda-doom uses
2026-06-19 16:54:55 +02:00
17 changed files with 194 additions and 259 deletions

No files matched your search

+39 -53
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 blinking prompt cursor
static tic_t con_tick; // console ticker for anim or blinking prompt cursor
// con_scrollup should use time (currenttime - lasttime)..
static boolean consoletoggle; // true when console key pushed, ticker will handle
@@ -103,7 +103,6 @@ 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);
@@ -132,7 +131,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_CALL|CV_SAVE, CV_Unsigned, CONS_height_Change, 0, NULL, NULL, 0, 0, NULL};
static consvar_t cons_height = {"con_height", "50", CV_SAVE, CV_Unsigned, NULL, 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
@@ -174,18 +173,6 @@ 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)
@@ -1650,54 +1637,53 @@ static void CON_DrawConsole(void)
}
// draw console text lines from top to bottom
if (con_curlines >= minheight)
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++)
{
i = con_cy - con_scrollup;
INT32 x;
size_t c;
// skip the last empty line due to the cursor being at the start of a new line
i--;
p = (UINT8 *)&con_buffer[((i > 0 ? i : 0)%con_totallines)*con_width];
i -= (con_curlines - minheight) / charheight;
if (rendermode == render_none)
return;
for (y = (con_curlines-minheight) % charheight; y <= con_curlines-minheight; y += charheight, i++)
for (c = 0, x = charwidth; c < con_width; c++, x += charwidth, p++)
{
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++)
while (*p & 0x80)
{
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);
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);
}
}
// draw prompt if enough place (not while game startup)
if ((con_curlines >= (minheight-charheight)) && !con_startup)
if ((con_curlines == con_destlines) && (con_curlines >= minheight) && !con_startup)
CON_DrawInput();
}
+8 -10
View File
@@ -1353,7 +1353,7 @@ static void IdentifyVersion(void)
//
// search for maps
//
static void D_CheckMapReplacements(boolean checkreplaced)
static void D_CheckMaps(boolean checkreplaced)
{
INT32 i;
char *name;
@@ -1829,19 +1829,17 @@ void D_SRB2Main(void)
// conversion sometimes needs the palette
V_ReloadPalette();
D_CheckMapReplacements(false);
D_CheckMaps(false);
W_InitMultipleFiles(startuppwads, startuppwadcount, true);
// Only search for pwad maps if we actually have a pwad added
if (startuppwadcount > 0)
{
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_CheckMaps(true);
}
D_CleanFile(startuppwads, startuppwadcount);
startuppwadcount = 0;
cht_Init();
@@ -1928,7 +1926,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,7 +150,6 @@ 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);
@@ -646,7 +645,6 @@ 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);
@@ -4593,23 +4591,6 @@ 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,6 +602,9 @@ 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.
@@ -666,6 +669,14 @@ 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
+2 -3
View File
@@ -857,8 +857,7 @@ static void G_HandleLocalDriftturn(ticcmd_t *cmd, UINT8 ssplayer)
static void G_BuildLocalTiccmd(ticcmd_t *cmd, UINT8 ssplayer, boolean freecam)
{
INT32 axis = 0;
const UINT8 forplayer = (ssplayer-1);
const boolean usejoystick = cv_usejoystick[forplayer].value;
const boolean usejoystick = cv_usejoystick[(ssplayer-1)].value;
// check for inputs and return button commands
// for stuff like joining with item button, saltyhop, honking, etc.
@@ -894,7 +893,7 @@ static void G_BuildLocalTiccmd(ticcmd_t *cmd, UINT8 ssplayer, boolean freecam)
#undef CHECKINPUT
axis = JoyAxis(AXISLOOKBACK, ssplayer);
camspin[forplayer] = (InputDown(gc_lookback, ssplayer) || (usejoystick && axis > 0));
camspin[ssplayer-1] = (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,7 +1135,6 @@ static void HU_SendChatMessage(void)
return;
}
}
// I'm very bad at C, I swear I am, additional checks eww!
if (spc != 0)
{
+35 -46
View File
@@ -4559,59 +4559,50 @@ 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;
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;
// 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;
}
}
}
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)
{
const boolean thunderhack = (player->kartstuff[k_curshield] && player->kartstuff[k_itemtype] == KITEM_THUNDERSHIELD);
boolean thunderhack = (player->kartstuff[k_curshield] && player->kartstuff[k_itemtype] == KITEM_THUNDERSHIELD);
if (thunderhack)
player->kartstuff[k_itemtype] = KITEM_NONE;
K_DropHnextList(player);
if (player->kartstuff[k_itemamount])
if (!P_MobjWasRemoved(player->mo) && player->kartstuff[k_itemamount])
{
K_DropPaperItem(player, thunderhack, 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_StripItems(player);
@@ -4667,7 +4658,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);
@@ -4693,8 +4684,9 @@ void K_RepairOrbitChain(mobj_t *orbit)
}
// Then recount to make sure item amount is correct
if (orbit->target && orbit->target->player) // !P_MobjWasRemoved(orbit->target)
if (orbit->target && orbit->target->player)
{
player_t *player = orbit->target->player;
INT32 num = 0;
mobj_t *cur = orbit->target->hnext;
@@ -4704,14 +4696,13 @@ void K_RepairOrbitChain(mobj_t *orbit)
{
prev = cur;
cur = cur->hnext;
if (++num > orbit->target->player->kartstuff[k_itemamount])
if (++num > player->kartstuff[k_itemamount])
P_RemoveMobj(prev);
else
prev->movedir = num;
}
if (orbit->target) // !P_MobjWasRemoved(orbit->target)
orbit->target->player->kartstuff[k_itemamount] = num;
player->kartstuff[k_itemamount] = num;
}
}
@@ -4943,10 +4934,8 @@ 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)
+66 -82
View File
@@ -1462,11 +1462,48 @@ boolean P_CheckRacers(void)
return false;
}
static void P_UpdateRemovedOrbital(mobj_t *target, mobj_t *inflictor, mobj_t *source)
/** 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;
// 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)
@@ -1480,7 +1517,7 @@ static void P_UpdateRemovedOrbital(mobj_t *target, mobj_t *inflictor, mobj_t *so
{
if (target->movedir != 0 && target->movedir < (UINT16)target->target->player->kartstuff[k_itemamount])
{
if (target->target->hnext) // !P_MobjWasRemoved(target->target->hnext))
if (target->target->hnext)
K_KillBananaChain(target->target->hnext, inflictor, source);
target->target->player->kartstuff[k_itemamount] = 0;
@@ -1509,60 +1546,14 @@ static void P_UpdateRemovedOrbital(mobj_t *target, mobj_t *inflictor, mobj_t *so
P_SetTarget(&target->target->hnext, NULL);
}
}
}
/** 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);
// 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
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->spectator)
target->flags2 &= ~MF2_DONTDRAW;
// Let EVERYONE know what happened to a player! 01-29-2002 Tails
if (target->player && !target->player->spectator)
{
target->flags2 &= ~MF2_DONTDRAW;
}
// if killed by a player
@@ -1572,7 +1563,6 @@ 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
@@ -1590,41 +1580,35 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
target->player->playerstate = PST_DEAD;
if (P_IsLocalPlayer(target->player))
if (cv_fading.value && P_IsLocalPlayer(target->player))
{
if (cv_fading.value)
{
if (netgame || multiplayer)
ms = cv_respawntime.value * 1000;
else
ms = 1000;
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);
}
if (target->player == &players[consoleplayer])
for (UINT8 i = 0; i <= splitscreen; i++)
{
if (target->player == P_GetLocalPlayerForNum(i))
{
// don't die in auto map,
// switch view prior to dying
if (automapactive)
if (i == 0 && automapactive)
AM_Stop();
}
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;
}
// 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; // didn't hit it
return true;
if (ld->polyobj && !(ld->polyobj->flags & POF_SOLID))
return true;
if (P_BoxOnLineSide(tmbbox, ld) != -1)
return true; // didn't hit it
return true;
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,13 +1004,11 @@ 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.
{
@@ -1018,7 +1016,6 @@ boolean P_BlockThingsIterator(INT32 x, INT32 y, boolean (*func)(mobj_t *))
return true;
}
}
P_SetTarget(&bnext, NULL);
return true;
}
+8 -9
View File
@@ -9167,11 +9167,6 @@ 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);
}
@@ -9197,10 +9192,6 @@ 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);
@@ -11038,7 +11029,11 @@ 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
{
@@ -11289,7 +11284,11 @@ 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;
}
+5 -11
View File
@@ -1178,7 +1178,6 @@ 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)
@@ -2496,9 +2495,7 @@ static void P_LoadRecordGhosts(void)
if (!gpath)
return;
const char *mapname = G_BuildMapName(gamemap);
sprintf(gpath,"%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s", srb2home, timeattackfolder, mapname);
sprintf(gpath,"%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s", srb2home, timeattackfolder, G_BuildMapName(gamemap));
// Best Time ghost
if (cv_ghost_besttime.value)
@@ -2548,10 +2545,9 @@ static void P_LoadRecordGhosts(void)
{
lumpnum_t l;
UINT8 j = 1;
while (j <= 99 && (l = W_CheckNumForName(va("%sS%02u", mapname, j))) != LUMPERROR)
while (j <= 99 && (l = W_CheckNumForName(va("%sS%02u",G_BuildMapName(gamemap),j))) != LUMPERROR)
{
G_AddGhost(va("%sS%02u", mapname, j));
G_AddGhost(va("%sS%02u",G_BuildMapName(gamemap),j));
j++;
}
}
@@ -2593,12 +2589,10 @@ static void P_InitMinimapInfo(void)
Patch_Free(minimapinfo.minimap_pic);
minimapinfo.minimap_pic = NULL;
const char *mapname = G_BuildMapName(gamemap);
lumpnum = W_CheckNumForName(va("%sR", mapname));
lumpnum = W_CheckNumForName(va("%sR", G_BuildMapName(gamemap)));
if (lumpnum != LUMPERROR)
minimapinfo.minimap_pic = W_CachePatchName(va("%sR", mapname), PU_PATCH);
minimapinfo.minimap_pic = W_CachePatchName(va("%sR", G_BuildMapName(gamemap)), PU_PATCH);
minimapinfo.min_x = bsp->bbox[0][BOXLEFT];
minimapinfo.max_x = bsp->bbox[0][BOXRIGHT];
+2
View File
@@ -4609,11 +4609,13 @@ 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,7 +646,9 @@ 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 || P_MobjWasRemoved(player->mo))
if (!player || !player->mo)
return true;
// This can happen when joining
+13 -18
View File
@@ -311,7 +311,6 @@ 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++)
@@ -436,7 +435,6 @@ 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);
@@ -2617,8 +2615,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
@@ -2627,7 +2625,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 improvements it yields
// we could kill skyVisible instead, but i want to keep the performance improvemnts it yields
// so we do this absolute trash
if ((tophigh
&& (frontsector->floorpic != skyflatnum && frontsector->ceilingpic != skyflatnum)) // try to guess if its a "window"
@@ -2639,16 +2637,14 @@ 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);
}
else
{
topstep = -FixedMul(rw_scalestep, worldbottom);
topfrac = (centeryfrac>>4) - FixedMul(worldbottom, rw_scale);
topstep = -FixedMul (rw_scalestep, worldbottomslope);
topfrac = (centeryfrac>>4) - FixedMul (worldbottomslope, rw_scale);
}
}
else
@@ -2657,18 +2653,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);
}
}
@@ -2786,7 +2782,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);
@@ -3049,7 +3045,6 @@ 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,7 +937,6 @@ static boolean S_AdjustSoundParams(const mobj_t *listener, const mobj_t *source,
listener_t listensource;
INT32 i;
// e6y
if (!listener)
return false;