diff --git a/src/menu-fn/colors.cpp b/src/menu-fn/colors.cpp index ba6fd310..81cf7ada 100644 --- a/src/menu-fn/colors.cpp +++ b/src/menu-fn/colors.cpp @@ -29,7 +29,7 @@ string Colors_RGB8_to_HEX(vector color) string out = "^x"; for (int i = 0; i < 3; i++) { - string a; + string a = ""; float b = rint(color[i] * 15); switch (b) { diff --git a/src/server/sentences.c b/src/server/sentences.c index cc96e96a..d7b71255 100644 --- a/src/server/sentences.c +++ b/src/server/sentences.c @@ -87,7 +87,7 @@ string Sentences_GetSamples(string word) { int len; - int gc; + int gc = 0; /* you never know what NPCs might do */ if (word == "") { diff --git a/src/server/tfc/spawn.c b/src/server/tfc/spawn.c index 703d0dc4..5e371cb0 100644 --- a/src/server/tfc/spawn.c +++ b/src/server/tfc/spawn.c @@ -48,7 +48,7 @@ CSEv_TeamJoin_f(float f) } player pl = (player)self; - entity spot; + entity spot = world; pl.classname = "player"; pl.health = self.max_health = 100; diff --git a/src/server/weapons.c b/src/server/weapons.c index 941ea88c..ff878bfd 100644 --- a/src/server/weapons.c +++ b/src/server/weapons.c @@ -43,7 +43,7 @@ int Weapons_AddItem(base_player pl, int w, int startammo) maxit = rules.MaxItemPerSlot(g_weapons[w].slot); if (maxit > 0) { int wantslot = g_weapons[w].slot; - int c; + int c = 0; for (int i = 0; i < g_weapons.length; i++) { if (pl.g_items & g_weapons[i].id && g_weapons[i].slot == wantslot) { c++; diff --git a/src/shared/gearbox/w_displacer.c b/src/shared/gearbox/w_displacer.c index 95d93e38..a4ce2048 100644 --- a/src/shared/gearbox/w_displacer.c +++ b/src/shared/gearbox/w_displacer.c @@ -51,10 +51,10 @@ w_displacer_precache(void) precache_sound("weapons/displacer_teleport.wav"); precache_sound("weapons/displacer_teleport_player.wav"); precache_model("models/w_displacer.mdl"); - precache_model("sprites/exit1.spr"); #else precache_model("models/v_displacer.mdl"); precache_model("models/p_displacer.mdl"); + precache_model("sprites/exit1.spr"); #endif } diff --git a/src/shared/sound.c b/src/shared/sound.c index 39395671..8746a2a2 100644 --- a/src/shared/sound.c +++ b/src/shared/sound.c @@ -255,7 +255,6 @@ Sound_Precache(string shader) dprint("\n"); search_end(sh); - fclose(fh); return -1; } @@ -269,6 +268,7 @@ Sound_Play(entity target, int chan, string shader) int flag; int sample; + flag = 0; sample = (int)hash_get(g_hashsounds, shader); if (sample < 0) { @@ -351,9 +351,10 @@ Sound_PlayAt(vector pos, string shader) int r; float radius; float pitch; - int flags; + int flag; int sample; + flag = 0; sample = (int)hash_get(g_hashsounds, shader); if (sample < 0) { @@ -369,13 +370,13 @@ Sound_PlayAt(vector pos, string shader) /* flags */ if (g_sounds[sample].flags & SNDFL_NOREVERB) { - flags |= SOUNDFLAG_NOREVERB; + flag |= SOUNDFLAG_NOREVERB; } if (g_sounds[sample].flags & SNDFL_GLOBAL) { radius = 0; } if (g_sounds[sample].flags & SNDFL_LOOPING) { - flags |= SOUNDFLAG_FORCELOOP; + flag |= SOUNDFLAG_FORCELOOP; } if (g_sounds[sample].flags & SNDFL_NODUPS) { if (g_sounds[sample].playc >= g_sounds[sample].sample_count) { @@ -385,7 +386,7 @@ Sound_PlayAt(vector pos, string shader) } #ifdef CLIENT if (g_sounds[sample].flags & SNDFL_OMNI) { - flags |= SOUNDFLAG_NOSPACIALISE; + flag |= SOUNDFLAG_NOSPACIALISE; } #endif @@ -400,7 +401,7 @@ Sound_Update(entity target, int channel, int sample, float volume) int r; float radius; float pitch; - int flags; + int flag; if (sample < 0) { return; @@ -413,16 +414,17 @@ Sound_Update(entity target, int channel, int sample, float volume) /* set pitch */ pitch = random(g_sounds[sample].pitch_min, g_sounds[sample].pitch_max); radius = g_sounds[sample].dist_max; + flag = 0; /* flags */ if (g_sounds[sample].flags & SNDFL_NOREVERB) { - flags |= SOUNDFLAG_NOREVERB; + flag |= SOUNDFLAG_NOREVERB; } if (g_sounds[sample].flags & SNDFL_GLOBAL) { radius = ATTN_NONE; } if (g_sounds[sample].flags & SNDFL_LOOPING) { - flags |= SOUNDFLAG_FORCELOOP; + flag |= SOUNDFLAG_FORCELOOP; } if (g_sounds[sample].flags & SNDFL_NODUPS) { if (g_sounds[sample].playc >= g_sounds[sample].sample_count) { @@ -431,7 +433,7 @@ Sound_Update(entity target, int channel, int sample, float volume) r = g_sounds[sample].playc++; } if (g_sounds[sample].flags & SNDFL_OMNI) { - flags |= SOUNDFLAG_NOSPACIALISE; + flag |= SOUNDFLAG_NOSPACIALISE; } soundupdate( @@ -441,7 +443,7 @@ Sound_Update(entity target, int channel, int sample, float volume) g_sounds[sample].volume * volume, radius, pitch, - flags, + flag, g_sounds[sample].offset ); } @@ -452,7 +454,7 @@ Sound_Speak(entity target, string shader) int r; float radius; float pitch; - int flags; + int flag; int sample; sample = (int)hash_get(g_hashsounds, shader); @@ -468,16 +470,17 @@ Sound_Speak(entity target, string shader) /* set pitch */ pitch = random(g_sounds[sample].pitch_min, g_sounds[sample].pitch_max); radius = g_sounds[sample].dist_max; + flag = 0; /* flags */ if (g_sounds[sample].flags & SNDFL_NOREVERB) { - flags |= SOUNDFLAG_NOREVERB; + flag |= SOUNDFLAG_NOREVERB; } if (g_sounds[sample].flags & SNDFL_GLOBAL) { radius = ATTN_NONE; } if (g_sounds[sample].flags & SNDFL_LOOPING) { - flags |= SOUNDFLAG_FORCELOOP; + flag |= SOUNDFLAG_FORCELOOP; } if (g_sounds[sample].flags & SNDFL_NODUPS) { if (g_sounds[sample].playc >= g_sounds[sample].sample_count) { @@ -486,11 +489,11 @@ Sound_Speak(entity target, string shader) r = g_sounds[sample].playc++; } if (g_sounds[sample].flags & SNDFL_FOLLOW) { - flags |= SOUNDFLAG_FOLLOW; + flag |= SOUNDFLAG_FOLLOW; } if (g_sounds[sample].flags & SNDFL_PRIVATE) { - flags |= SOUNDFLAG_UNICAST; + flag |= SOUNDFLAG_UNICAST; msg_entity = target; } diff --git a/src/shared/valve/fx_breakmodel.c b/src/shared/valve/fx_breakmodel.c index 4a6c967b..3e3f6442 100644 --- a/src/shared/valve/fx_breakmodel.c +++ b/src/shared/valve/fx_breakmodel.c @@ -67,7 +67,7 @@ FX_BreakModel(int count, vector vMins, vector vMaxs, vector vVel, float fStyle) #else static void FX_BreakModel_Remove(void) { remove(self) ; } - float fModelCount; + float fModelCount = 0; vector vecPos; string sModel = ""; @@ -109,9 +109,7 @@ FX_BreakModel(int count, vector vMins, vector vMaxs, vector vVel, float fStyle) } vector vWorldPos; - vWorldPos[0] = vMins[0] + (0.5 * (vMaxs[0] - vMins[0])); - vWorldPos[1] = vMins[1] + (0.5 * (vMaxs[1] - vMins[1])); - vWorldPos[2] = vMins[2] + (0.5 * (vMaxs[2] - vMins[2])); + vWorldPos = vMins + (0.5 * (vMaxs - vMins)); switch (fStyle) { case GSMATERIAL_GLASS: diff --git a/src/shared/valve/w_gauss.c b/src/shared/valve/w_gauss.c index 04c720a1..ac2f4c39 100644 --- a/src/shared/valve/w_gauss.c +++ b/src/shared/valve/w_gauss.c @@ -131,9 +131,9 @@ void w_gauss_precache(void) precache_sound("weapons/electro4.wav"); precache_sound("weapons/electro5.wav"); precache_sound("weapons/electro6.wav"); - precache_sound("ambience/pulsemachine.wav"); precache_sound("weapons/gauss2.wav"); #else + precache_sound("ambience/pulsemachine.wav"); precache_model("models/v_gauss.mdl"); precache_model("models/p_gauss.mdl"); #endif diff --git a/src/vgui/font.cpp b/src/vgui/font.cpp index 97772797..ff5ce14c 100644 --- a/src/vgui/font.cpp +++ b/src/vgui/font.cpp @@ -41,8 +41,8 @@ Font_Load (string strFile, font_s &fntNew) fntNew.flAlpha = 1.0f; fntNew.iFlags = 0; #else - string strTemp; - string strFontPath; + string strTemp = ""; + string strFontPath = ""; filestream fileFont = fopen(strFile, FILE_READ); fntNew.iID = 0; fntNew.iScale = 8;