diff --git a/src/d_main.cpp b/src/d_main.cpp index 3f3c281dd..4286cdc6e 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -1151,6 +1151,9 @@ void D_SRB2Loop(void) // void D_StartTitle(void) { + if (dedicated) + I_Error("D_StartTitle is called on dedicated server"); + INT32 i; S_StopMusic(); diff --git a/src/d_net.c b/src/d_net.c index f8e5ee032..b4e274fc6 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -66,7 +66,7 @@ static INT32 rebound_head, rebound_tail; INT32 net_bandwidth; /// \brief max length per packet -INT16 hardware_MAXPACKETLENGTH; +INT16 hardware_MAXPACKETLENGTH = 0; boolean (*I_NetGet)(void) = NULL; void (*I_NetSend)(void) = NULL; @@ -106,7 +106,7 @@ INT32 ticruned = 0, ticmiss = 0; // globals INT32 getbps, sendbps; -float lostpercent, duppercent, gamelostpercent; +float lostpercent = 0.0f, duppercent = 0.0f, gamelostpercent = 0.0f; INT32 packetheaderlength; boolean Net_GetNetStat(void) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 84b46fe4d..1bff0dd8f 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -656,6 +656,7 @@ consvar_t cv_kartbubble_defense_canidle = CVAR_INIT ("kartbubble_defense_canidle static CV_PossibleValue_t bubble_defense_damagerate_cons_t[] = {{0, "MIN"}, {FRACUNIT, "MAX"}, {0, NULL}}; consvar_t cv_kartbubble_defense_damagerate = CVAR_INIT ("kartbubble_defense_damagerate", "1.0", CV_NETVAR|CV_FLOAT, bubble_defense_damagerate_cons_t, NULL); consvar_t cv_kartbubble_boost_allow = CVAR_INIT ("kartbubble_boost_allow", "On", CV_NETVAR, CV_OnOff, NULL); +consvar_t cv_kartbubble_boost_offroadignore = CVAR_INIT ("kartbubble_boost_offroadignore", "On", CV_NETVAR, CV_OnOff, NULL); consvar_t cv_kartflame_fastfuel = CVAR_INIT ("kartflame_fastfuel", "Off", CV_NETVAR, CV_OnOff, NULL); // we want this to be default now apparently consvar_t cv_kartflame_offroadburn = CVAR_INIT ("kartflame_offroadburn", "On", CV_NETVAR, CV_OnOff, NULL); @@ -714,7 +715,7 @@ consvar_t cv_rollingdemos = CVAR_INIT ("rollingdemos", "On", CV_SAVE, CV_OnOff, static CV_PossibleValue_t pointlimit_cons_t[] = {{1, "MIN"}, {MAXSCORE, "MAX"}, {0, "None"}, {0, NULL}}; consvar_t cv_pointlimit = CVAR_INIT ("pointlimit", "None", CV_NETVAR|CV_CALL|CV_NOINIT, pointlimit_cons_t, PointLimit_OnChange); static CV_PossibleValue_t timelimit_cons_t[] = {{1, "MIN"}, {99999, "MAX"}, {0, "None"}, {0, NULL}}; -consvar_t cv_timelimit = CVAR_INIT ("timelimit", "None", CV_NETVAR|CV_CALL|CV_NOINIT, timelimit_cons_t, TimeLimit_OnChange); +consvar_t cv_timelimit = CVAR_INIT ("timelimit", "2", CV_NETVAR|CV_CALL|CV_NOINIT, timelimit_cons_t, TimeLimit_OnChange); static CV_PossibleValue_t numlaps_cons_t[] = {{0, "MIN"}, {MAX_LAPS, "MAX"}, {-1, "Map default"}, {0, NULL}}; consvar_t cv_numlaps = CVAR_INIT ("numlaps", "Map default", CV_NETVAR|CV_CALL|CV_CHEAT, numlaps_cons_t, NumLaps_OnChange); @@ -824,7 +825,7 @@ boolean forceresetplayers = false; boolean deferencoremode = false; UINT8 splitscreen = 0; boolean circuitmap = false; -INT32 adminplayers[MAXPLAYERS]; +INT32 adminplayers[MAXPLAYERS] = {}; #define VOTEROWS ((cv_votemaxrows.value*3) + ((cv_votemaxrows.value > 1) ? (cv_votemaxrows.value - 1) : 0)) #define VOTEROWSADDSONE ((cv_votemaxrows.value*3) + 1 + ((cv_votemaxrows.value > 1) ? (cv_votemaxrows.value - 1) : 0)) @@ -3419,8 +3420,7 @@ void D_PickVote(void) SendNetXCmd(XD_PICKVOTE, &buf, 2); } -static char * -ConcatCommandArgv (int start, int end) +static char *ConcatCommandArgv (int start, int end) { char *final; diff --git a/src/d_netcmd.h b/src/d_netcmd.h index d793f58df..92aa7df48 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -203,6 +203,7 @@ extern consvar_t cv_kartinvin_midtime; extern consvar_t cv_kartbubble_defense_canidle; extern consvar_t cv_kartbubble_defense_damagerate; extern consvar_t cv_kartbubble_boost_allow; +extern consvar_t cv_kartbubble_boost_offroadignore; extern consvar_t cv_kartflame_fastfuel; extern consvar_t cv_kartflame_offroadburn; extern consvar_t cv_kartaltshrink_arrowbullet; diff --git a/src/d_netfil.c b/src/d_netfil.c index 9c5fedbdc..f34bda191 100644 --- a/src/d_netfil.c +++ b/src/d_netfil.c @@ -2002,7 +2002,8 @@ void CURLGetFile(void) e = m->easy_handle; easyres = m->data.result; - char *filename = Z_StrDup(curl_realname); + char *filename = malloc(strlen(curl_realname)+1); + strcpy(filename, curl_realname); nameonly(filename); if (easyres != CURLE_OK) @@ -2040,7 +2041,7 @@ void CURLGetFile(void) } } - Z_Free(filename); + free(filename); curl_curfile->file = NULL; #ifndef HAVE_THREADS curl_running = false; diff --git a/src/deh_tables.c b/src/deh_tables.c index 1f1044c8f..2bae52203 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -1794,5 +1794,7 @@ struct int_const_s const INT_CONST[] = { {"BUMPSPARK_RESET100", BUMPSPARK_RESET100}, {"BUMPSPARK_ALL", BUMPSPARK_ALL}, + {"BLANKART", 1}, + {NULL,0} }; diff --git a/src/filesrch.c b/src/filesrch.c index 7a5b33464..f09c24aab 100644 --- a/src/filesrch.c +++ b/src/filesrch.c @@ -49,7 +49,7 @@ size_t menupathindex[menudepth]; size_t menudepthleft = menudepth; char menusearchbuf[MAXSTRINGLENGTH+1]; -textinput_t menusearch; +textinput_t menusearch = {}; char **dirmenu, **coredirmenu; // core only local for this file size_t sizedirmenu, sizecoredirmenu; // ditto @@ -237,10 +237,13 @@ static boolean filemenucmp(char *haystack, char *needle) { static char localhaystack[128]; strlcpy(localhaystack, haystack, 128); + if (!cv_addons_search_case.value) strupr(localhaystack); + if (cv_addons_search_type.value) - return (strstr(localhaystack, needle) != 0); + return (strstr(localhaystack, needle) != NULL); + return (!strncmp(localhaystack, needle, menusearch.length)); } diff --git a/src/g_game.c b/src/g_game.c index 2dfce20f6..1c9b41aa6 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -174,13 +174,13 @@ UINT16 skincolor_bluering = SKINCOLOR_PERIWINKLE; boolean exitfadestarted = false; -cutscene_t *cutscenes[128]; +cutscene_t *cutscenes[128] = {}; textprompt_t *textprompts[MAX_PROMPTS]; INT16 nextmapoverride; UINT8 skipstats; -struct quake quake; +struct quake quake = {}; // Map Header Information mapheader_t** mapheaderinfo = {NULL}; @@ -280,7 +280,7 @@ exitcondition_t g_exit; fixed_t gravity; fixed_t mapobjectscale; -struct maplighting maplighting; +struct maplighting maplighting = {}; INT16 autobalance; //for CTF team balance INT16 teamscramble; //for CTF team scramble diff --git a/src/g_input.c b/src/g_input.c index f0d601f67..d972140e1 100644 --- a/src/g_input.c +++ b/src/g_input.c @@ -15,6 +15,7 @@ #include "doomstat.h" #include "g_input.h" #include "i_system.h" +#include "k_items.h" #include "keys.h" #include "hu_stuff.h" // need HUFONT start & end #include "d_net.h" @@ -25,6 +26,7 @@ #include "g_game.h" #include "v_video.h" #include "p_local.h" +#include "k_kart.h" #define MAXMOUSESENSITIVITY 100 // sensitivity steps @@ -135,11 +137,11 @@ static void led_off_handle4(void) // current state of the keys // JOYAXISRANGE for fully pressed, 0 for not pressed -INT32 gamekeydown[MAXDEVICES][NUMINPUTS]; -boolean deviceResponding[MAXDEVICES]; +INT32 gamekeydown[MAXDEVICES][NUMINPUTS] = {}; +boolean deviceResponding[MAXDEVICES] = {false}; // several key codes (or virtual key) per game control -INT32 gamecontrol[MAXSPLITSCREENPLAYERS][num_gamecontrols][MAXINPUTMAPPING]; +INT32 gamecontrol[MAXSPLITSCREENPLAYERS][num_gamecontrols][MAXINPUTMAPPING] = {}; INT32 gamecontroldefault[num_gamecontrols][MAXINPUTMAPPING] = { [gc_aimforward ] = {KEY_UPARROW, KEY_AXIS1+2 }, // Left Y- @@ -693,7 +695,12 @@ void G_DeviceRumbleTick(void) //low = high = FRACUNIT / 6; low = high = FixedMul((RUMBLE_VERYSTRONG), (FixedDiv(player->spinouttimer, (3*TICRATE / 2)))); // try do some some kinda fadeout, 3*TICRATE / 2 is the "default" spinout time } - else if (player->sneakertimer > (sneakertime-(TICRATE/2))) + else if (player->flamestore && !player->offroad) + { + high = (player->flamestore * RUMBLE_MODERATE) / FLAMESTOREMAX; + lenght = 32; + } + else if (player->sneakertimer > (sneakertime-(TICRATE/2)) || player->bubbleboost > (BUBBLEBOOSTTIME-(TICRATE/2))) { low = high = RUMBLE_STRONG; } @@ -706,6 +713,10 @@ void G_DeviceRumbleTick(void) { high = RUMBLE_WEAK; } + else if (player->flameoverheat) + { + low = RUMBLE_MODERATE; + } else if (player->invincibilitytimer) { high = RUMBLE_MODERATE; diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 0333e979c..8268c12c4 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -1694,6 +1694,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom // Used for height comparisons and etc across FOFs and slopes fixed_t high1, highslope1, low1, lowslope1; + fixed_t high2, highslope2, low2, lowslope2; INT32 texnum; line_t * newline = NULL; // Multi-Property FOF @@ -1707,18 +1708,6 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom { for (rover = gl_backsector->ffloors; rover; rover = rover->next) { - boolean bothsides = false; - // Skip if it exists on both sectors. - ffloor_t * r2; - for (r2 = gl_frontsector->ffloors; r2; r2 = r2->next) - if (rover->master == r2->master) - { - bothsides = true; - break; - } - - if (bothsides) continue; - if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_RENDERSIDES)) continue; if (!(rover->fofflags & FOF_ALLSIDES) && rover->fofflags & FOF_INVERTSIDES) @@ -1730,6 +1719,45 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom if ((high1 < lowcut || highslope1 < lowcutslope) || (low1 > highcut || lowslope1 > highcutslope)) continue; + ffloor_t * r2; + for (r2 = gl_frontsector->ffloors; r2; r2 = r2->next) + { + if (r2->master == rover->master) // Skip if same control line. + break; + + const ffloortype_e r2flags = r2->fofflags; + + if (!(r2flags & FOF_EXISTS) || !(r2flags & FOF_RENDERSIDES)) + continue; + + if (rover->fofflags & FOF_EXTRA) + { + if (!(r2flags & FOF_CUTEXTRA)) + continue; + + if (r2flags & FOF_EXTRA && (r2flags & (FOF_TRANSLUCENT|FOF_FOG)) != (rover->fofflags & (FOF_TRANSLUCENT|FOF_FOG))) + continue; + } + else + { + if (!(r2flags & FOF_CUTSOLIDS)) + continue; + } + + SLOPEPARAMS(*r2->t_slope, high2, highslope2, *r2->topheight) + SLOPEPARAMS(*r2->b_slope, low2, lowslope2, *r2->bottomheight) + + if ((high2 < lowcut || highslope2 < lowcutslope) || (low2 > highcut || lowslope2 > highcutslope)) + continue; + if ((high1 > high2 || highslope1 > highslope2) || (low1 < low2 || lowslope1 < lowslope2)) + continue; + + break; + } + + if (r2) + continue; + texnum = R_GetTextureNum(sides[rover->master->sidenum[0]].midtexture); if (rover->master->flags & ML_TFERLINE) @@ -1867,18 +1895,6 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom { for (rover = gl_frontsector->ffloors; rover; rover = rover->next) { - boolean bothsides = false; - // Skip if it exists on both sectors. - ffloor_t * r2; - for (r2 = gl_backsector->ffloors; r2; r2 = r2->next) - if (rover->master == r2->master) - { - bothsides = true; - break; - } - - if (bothsides) continue; - if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_RENDERSIDES)) continue; if (!(rover->fofflags & FOF_ALLSIDES || rover->fofflags & FOF_INVERTSIDES)) @@ -1890,6 +1906,44 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom if ((high1 < lowcut || highslope1 < lowcutslope) || (low1 > highcut || lowslope1 > highcutslope)) continue; + ffloor_t * r2; + for (r2 = gl_backsector->ffloors; r2; r2 = r2->next) + { + if (r2->master == rover->master) // Skip if same control line. + break; + + const ffloortype_e r2flags = r2->fofflags; + + if (!(r2flags & FOF_EXISTS) || !(r2flags & FOF_RENDERSIDES)) + continue; + + if (rover->fofflags & FOF_EXTRA) + { + if (!(r2flags & FOF_CUTEXTRA)) + continue; + + if (r2flags & FOF_EXTRA && (r2flags & (FOF_TRANSLUCENT|FOF_FOG)) != (rover->fofflags & (FOF_TRANSLUCENT|FOF_FOG))) + continue; + } + else + { + if (!(r2flags & FOF_CUTSOLIDS)) + continue; + } + + SLOPEPARAMS(*r2->t_slope, high2, highslope2, *r2->topheight) + SLOPEPARAMS(*r2->b_slope, low2, lowslope2, *r2->bottomheight) + + if ((high2 < lowcut || highslope2 < lowcutslope) || (low2 > highcut || lowslope2 > highcutslope)) + continue; + if ((high1 > high2 || highslope1 > highslope2) || (low1 < low2 || lowslope1 < lowslope2)) + continue; + + break; + } + if (r2) + continue; + texnum = R_GetTextureNum(sides[rover->master->sidenum[0]].midtexture); if (rover->master->flags & ML_TFERLINE) diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index 3700083e2..099692ea0 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -671,7 +671,7 @@ typedef struct gl_shaderstate_s static gl_shaderstate_t gl_shaderstate; // Shader info -static float shader_leveltime = 0; +static float shader_leveltime = 0.0f; static float shader_light_x = 0.0f; static float shader_light_y = 0.0f; static float shader_light_z = 0.0f; diff --git a/src/i_time.c b/src/i_time.c index 74380e6f7..f0b2b1ff4 100644 --- a/src/i_time.c +++ b/src/i_time.c @@ -21,7 +21,7 @@ #include "m_fixed.h" #include "i_system.h" -timestate_t g_time; +timestate_t g_time = {}; static CV_PossibleValue_t timescale_cons_t[] = {{FRACUNIT/20, "MIN"}, {20*FRACUNIT, "MAX"}, {0, NULL}}; consvar_t cv_timescale = CVAR_INIT ("timescale", "1.0", CV_NETVAR|CV_CHEAT|CV_FLOAT, timescale_cons_t, NULL); diff --git a/src/k_hud.c b/src/k_hud.c index 6a47c82bc..428db2ed7 100644 --- a/src/k_hud.c +++ b/src/k_hud.c @@ -136,7 +136,7 @@ static patch_t *kp_racefinish[6]; static patch_t *kp_positionnum[NUMPOSNUMS][NUMPOSFRAMES]; static patch_t *kp_winnernum[NUMPOSFRAMES]; -patch_t *kp_facenum[MAXPLAYERS+1]; +patch_t *kp_facenum[MAXPLAYERS+1] = {}; static patch_t *kp_facehighlight[8]; static patch_t *kp_nocontestminimap; diff --git a/src/k_items.c b/src/k_items.c index f8657f4b8..ceac35d8d 100644 --- a/src/k_items.c +++ b/src/k_items.c @@ -2466,7 +2466,7 @@ void K_PlayerItemThink(player_t *player, boolean onground) // experiment: don't boost, just give invulnerability if (cv_kartbubble_boost_allow.value) { - player->bubbleboost = 7 * sneakertime / 10; + player->bubbleboost = BUBBLEBOOSTTIME; } player->flashing = 4*TICRATE/7; } diff --git a/src/k_items.h b/src/k_items.h index 972c5c425..9a7f363e8 100644 --- a/src/k_items.h +++ b/src/k_items.h @@ -229,6 +229,8 @@ void K_PlayerItemThink(player_t *player, boolean onground); extern consvar_t cv_karteggmine_slotlock; extern consvar_t cv_karteggmine_slotbrick; +#define BUBBLEBOOSTTIME (7 * sneakertime / 10) + #ifdef __cplusplus } // extern "C" #endif diff --git a/src/k_kart.c b/src/k_kart.c index 49b5b2d74..7fa7252dd 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -421,6 +421,7 @@ void K_RegisterKartStuff(void) CV_RegisterVar(&cv_kartbubble_defense_canidle); CV_RegisterVar(&cv_kartbubble_defense_damagerate); CV_RegisterVar(&cv_kartbubble_boost_allow); + CV_RegisterVar(&cv_kartbubble_boost_offroadignore); CV_RegisterVar(&cv_kartflame_fastfuel); CV_RegisterVar(&cv_kartflame_offroadburn); CV_RegisterVar(&cv_kartaltshrink_arrowbullet); @@ -2158,7 +2159,7 @@ boolean K_ApplyOffroad(const player_t *player) if (modeattacking != ATTACKING_NONE) sneakertimer = player->sneakertimer > 0; - if (player->hyudorotimer || sneakertimer) + if (player->hyudorotimer || sneakertimer || (cv_kartbubble_boost_offroadignore.value && player->bubbleboost)) return false; return true; } diff --git a/src/lua_mobjlib.c b/src/lua_mobjlib.c index d95856695..6cdec7b59 100644 --- a/src/lua_mobjlib.c +++ b/src/lua_mobjlib.c @@ -312,6 +312,12 @@ static int mobj_get(lua_State *L) case mobj_roll: lua_pushangle(L, mo->roll); break; + case mobj_slopepitch: + lua_pushangle(L, mo->slopepitch); + break; + case mobj_sloperoll: + lua_pushangle(L, mo->sloperoll); + break; case mobj_rollangle: lua_pushangle(L, mo->rollangle); break; @@ -701,6 +707,12 @@ static int mobj_set(lua_State *L) case mobj_roll: mo->roll = luaL_checkangle(L, 3); break; + case mobj_slopepitch: + mo->slopepitch = luaL_checkangle(L, 3); + break; + case mobj_sloperoll: + mo->sloperoll = luaL_checkangle(L, 3); + break; case mobj_rollangle: mo->rollangle = luaL_checkangle(L, 3); break; diff --git a/src/lua_script.c b/src/lua_script.c index 6fc1a48d4..f134c0d68 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -356,10 +356,16 @@ int LUA_PushGlobals(lua_State *L, const char *word) lua_pushinteger(L, gravity); return 1; } else if (fastcmp(word,"VERSION")) { - lua_pushinteger(L, VERSION); + if (lua_compatmode) + lua_pushinteger(L, 1); + else + lua_pushinteger(L, VERSION); return 1; } else if (fastcmp(word,"SUBVERSION")) { - lua_pushinteger(L, SUBVERSION); + if (lua_compatmode) + lua_pushinteger(L, 6); + else + lua_pushinteger(L, SUBVERSION); return 1; } else if (fastcmp(word,"VERSIONSTRING")) { lua_pushstring(L, VERSIONSTRING); diff --git a/src/m_cheat.c b/src/m_cheat.c index f73d42f03..7c2d1abc5 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -713,7 +713,7 @@ void Command_Resetemeralds_f(void) // Devmode // -UINT32 cht_debug; +UINT32 cht_debug = 0; struct debugFlagNames_s const debug_flag_names[] = { diff --git a/src/m_menu.c b/src/m_menu.c index bdfee4c42..e460dddc9 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -4553,7 +4553,7 @@ INT32 MR_QuitAddons(INT32 choice) } // ---- REPLAY HUT ----- -menudemo_t *demolist; +menudemo_t *demolist = NULL; #define DF_ENCORE 0x40 static INT16 replayScrollTitle = 0; @@ -5578,7 +5578,7 @@ void M_RefreshPauseMenu(void) // SKY ROOM // ======== -UINT8 skyRoomMenuTranslations[MAXUNLOCKABLES]; +UINT8 skyRoomMenuTranslations[MAXUNLOCKABLES] = {}; static char *M_GetConditionString(condition_t cond) { diff --git a/src/p_maputl.c b/src/p_maputl.c index 4c89cda17..44fbe9f0f 100644 --- a/src/p_maputl.c +++ b/src/p_maputl.c @@ -1490,7 +1490,7 @@ boolean P_BlockThingsIterator(INT32 x, INT32 y, BlockItReturn_t (*func)(mobj_t * static intercept_t *intercepts = NULL; static intercept_t *intercept_p = NULL; -divline_t g_trace; +divline_t g_trace = {}; //SoM: 4/6/2000: Remove limit on intercepts. static void P_CheckIntercepts(void) diff --git a/src/p_mobj.c b/src/p_mobj.c index fb943afb3..2a35f9c72 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -11772,9 +11772,9 @@ void P_RemoveFloorSpriteSlope(mobj_t *mobj) // // P_RemoveMobj // -mapthing_t *itemrespawnque[ITEMQUESIZE]; -tic_t itemrespawntime[ITEMQUESIZE]; -size_t iquehead, iquetail; +mapthing_t *itemrespawnque[ITEMQUESIZE] = {}; +tic_t itemrespawntime[ITEMQUESIZE] = {}; +size_t iquehead = 0, iquetail = 0; #ifdef PARANOIA //#define SCRAMBLE_REMOVED // Force debug build to crash when Removed mobj is accessed diff --git a/src/p_setup.c b/src/p_setup.c index 5981439db..112378981 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -537,9 +537,9 @@ void P_AllocMapHeader(INT16 i) // #define MAXLEVELFLATS 256 -size_t nummaxflats; -size_t numlevelflats; -levelflat_t *levelflats; +size_t nummaxflats = 0; +size_t numlevelflats = 0; +levelflat_t *levelflats = NULL; //SoM: Other files want this info. size_t P_PrecacheLevelFlats(void) @@ -8148,8 +8148,8 @@ void P_SetupLevelSky(const char *skytexname, boolean global) R_SetupSkyDraw(); } -static const char *maplumpname; -lumpnum_t lastloadedmaplumpnum; // for comparative savegame +static const char *maplumpname = NULL; +lumpnum_t lastloadedmaplumpnum = LUMPERROR; // for comparative savegame // // P_LevelInitStuff @@ -8619,7 +8619,7 @@ static void P_InitGametype(void) } } -struct minimapinfo minimapinfo; +struct minimapinfo minimapinfo = {}; static void P_InitMinimapInfo(void) { diff --git a/src/p_spec.c b/src/p_spec.c index 241dacd18..e821d2bb8 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -9336,6 +9336,7 @@ boolean P_AllowFriction(mobj_t *mobj) if (mobj->player->invincibilitytimer || mobj->player->hyudorotimer || mobj->player->sneakertimer + || (cv_kartbubble_boost_offroadignore.value && mobj->player->bubbleboost) || mobj->player->growshrinktimer > 0 || K_IsAltShrunk(mobj->player)) return false; diff --git a/src/p_user.c b/src/p_user.c index a5b61fe45..4de6b61f9 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2033,7 +2033,7 @@ static void P_3dMovement(player_t *player) // If "no" to 1, we're not reaching any limits yet, so ignore this entirely! // -Shadow Hog newMagnitude = R_PointToDist2(player->mo->momx - player->cmomx, player->mo->momy - player->cmomy, 0, 0); - if (player->offroad > 0 || !player->outruntime) + if (player->offroad > 0 || player->loop.radius == 0 || player->outruntime == 0) { if (newMagnitude > K_GetKartSpeed(player, true, true)) //topspeed) { @@ -2721,7 +2721,7 @@ static void P_DeathThink(player_t *player) // P_MoveCamera: make sure the camera is not outside the world and looks at the player avatar // -camera_t camera[MAXSPLITSCREENPLAYERS]; // Four cameras, three for splitscreen +camera_t camera[MAXSPLITSCREENPLAYERS] = {}; // Four cameras, three for splitscreen static void CV_CamRotate_OnChange(void) { diff --git a/src/r_things.cpp b/src/r_things.cpp index 24623d6fd..9da9c674d 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -793,7 +793,7 @@ void R_DrawMaskedColumn(drawcolumndata_t* dc, column_t *column, column_t *bright dc->texturemid = basetexturemid; } -INT32 lengthcol; // column->length : for flipped column function pointers and multi-patch on 2sided wall = texture->height +INT32 lengthcol = 0; // column->length : for flipped column function pointers and multi-patch on 2sided wall = texture->height void R_DrawFlippedMaskedColumn(drawcolumndata_t* dc, column_t *column, column_t *brightmap, INT32 baseclip) { @@ -3992,7 +3992,7 @@ static void R_DrawMaskedList (drawnode_t* head) void R_DrawMasked(maskcount_t* masks, INT32 nummasks) { ZoneScoped; - drawnode_t *heads; /**< Drawnode lists; as many as number of views/portals. */ + drawnode_t *heads = NULL; /**< Drawnode lists; as many as number of views/portals. */ INT32 i; heads = static_cast(calloc(nummasks, sizeof(drawnode_t))); diff --git a/src/v_video.c b/src/v_video.c index 06940540a..faad604b6 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -3619,6 +3619,9 @@ INT32 V_SubStringWidth(const char *string, INT32 length, INT32 option) if ((UINT8)c & 0x80) //color parsing! -Inuyasha 2.16.09 continue; + if (c < HU_FONTSTART) + continue; // this is not a proper character. + c = toupper(c) - HU_FONTSTART; if (c < 0 || c >= HU_FONTSIZE || !fontv[HU_FONT].font[c]) lw += spacewidth; @@ -3672,6 +3675,9 @@ INT32 V_SmallSubStringWidth(const char *string, INT32 length, INT32 option) if ((UINT8)c & 0x80) //color parsing! -Inuyasha 2.16.09 continue; + if (c < HU_FONTSTART) + continue; // this is not a proper character. + c = toupper(c) - HU_FONTSTART; if (c < 0 || c >= HU_FONTSIZE || !fontv[HU_FONT].font[c]) lw += spacewidth; @@ -3724,6 +3730,9 @@ INT32 V_ThinSubStringWidth(const char *string, INT32 length, INT32 option) if ((UINT8)c & 0x80) //color parsing! -Inuyasha 2.16.09 continue; + if (c < HU_FONTSTART) + continue; // this is not a proper character. + if (!lowercase || !fontv[TINY_FONT].font[c-HU_FONTSTART]) c = toupper(c); c -= HU_FONTSTART;