From a2eee3150a5b3e306c57b0e74c00a6156314491b Mon Sep 17 00:00:00 2001 From: Aaron Dean <8dino2@gmail.com> Date: Thu, 7 Sep 2023 12:51:19 -0400 Subject: [PATCH] Fixed some uninitialized vars --- actionlite/action/a_game.h | 3 ++- actionlite/action/a_team.cpp | 26 ++++++++++++++------------ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/actionlite/action/a_game.h b/actionlite/action/a_game.h index cdfe1fe..27c1aba 100644 --- a/actionlite/action/a_game.h +++ b/actionlite/action/a_game.h @@ -56,4 +56,5 @@ void AddKilledPlayer (edict_t * self, edict_t * ent); void MakeAllLivePlayersObservers( void ); //a_cmds.c -void Cmd_NextMap_f( edict_t * ent ); +// Superceded by SVCmd_NextMap_f ? +//void Cmd_NextMap_f( edict_t * ent ); diff --git a/actionlite/action/a_team.cpp b/actionlite/action/a_team.cpp index 55f01fa..1daef01 100644 --- a/actionlite/action/a_team.cpp +++ b/actionlite/action/a_team.cpp @@ -703,7 +703,7 @@ void Team_f (edict_t * ent) void JoinTeam (edict_t * ent, int desired_team, int skip_menuclose) { - char *s; + char s[MAX_SKINLEN]; const char *a; int oldTeam; @@ -1012,9 +1012,11 @@ void CleanLevel () edict_t *ent; base = 1 + game.maxclients + BODY_QUEUE_SIZE; ent = g_edicts + base; - action_weapon_num_t weapNum; - action_item_num_t itemNum; - action_ammo_num_t ammoNum; + + // Setting defaults + action_weapon_num_t weapNum = MK23_NUM; + action_item_num_t itemNum = KEV_NUM; + action_ammo_num_t ammoNum = MK23_ANUM; for (i = base; i < globals.num_edicts; i++, ent++) { @@ -1074,7 +1076,7 @@ void ResetScores (bool playerScores) { int i; edict_t *ent; - ctfgame_t *ctfgame; + ctfgame_t ctfgame; team_round_going = team_round_countdown = team_game_going = 0; current_round_length = 0; @@ -1095,13 +1097,13 @@ void ResetScores (bool playerScores) } - ctfgame->team1 = 0; - ctfgame->team2 = 0; - ctfgame->total1 = 0; - ctfgame->total2 = 0; - ctfgame->last_flag_capture = 0_ms; - ctfgame->last_capture_team = 0; - ctfgame->halftime = 0; + ctfgame.team1 = 0; + ctfgame.team2 = 0; + ctfgame.total1 = 0; + ctfgame.total2 = 0; + ctfgame.last_flag_capture = 0_ms; + ctfgame.last_capture_team = 0; + ctfgame.halftime = 0; if(!playerScores) return;