Skip to content

Commit 893294b

Browse files
committed
SERVER: Handle all fog setting in Zoning_SetFog()
1 parent ae97101 commit 893294b

2 files changed

Lines changed: 23 additions & 32 deletions

File tree

source/server/ai/zoning_core.qc

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -188,20 +188,31 @@ void(entity players) Zoning_SetFog =
188188
Zoning_GetCurrentZone(players);
189189

190190
// if this round is a dog round
191-
if (roundtype == 2) {
191+
if (rounds == dogRound && map_has_hellhounds) {
192+
roundtype = 2;
192193
fog_value = strcat(game_modifier_hellhound_fog_color, "\n");
193194
} else {
194-
// if it's a normal zombie round and there is
195-
// no fog value stored in this zone
196-
if (stored_zones[players.current_zone].fog_value == "") {
197-
if (game_modifier_default_fog_color != "")
198-
// use whole map fog if available
199-
fog_value = strcat(game_modifier_default_fog_color, "\n");
200-
else
201-
fog_value = "0 0 0 0 0\n";
195+
// zombie round
196+
roundtype = 1;
197+
198+
if (has_zone_file) {
199+
// no fog value stored in this zone
200+
if (stored_zones[players.current_zone].fog_value == "") {
201+
if (game_modifier_default_fog_color != "")
202+
// use whole map fog if available
203+
fog_value = strcat(game_modifier_default_fog_color, "\n");
204+
else
205+
fog_value = "0 0 0 0 0\n";
206+
} else {
207+
// we have custom fog for this zone
208+
fog_value = strcat(stored_zones[players.current_zone].fog_value, "\n");
209+
}
202210
} else {
203-
// we have custom fog for this zone
204-
fog_value = strcat(stored_zones[players.current_zone].fog_value, "\n");
211+
if (game_modifier_default_fog_color != "") {
212+
fog_value = strcat(game_modifier_default_fog_color, "\n");
213+
} else {
214+
fog_value = "0 0 0 0 0\n";
215+
}
205216
}
206217
}
207218

source/server/rounds.qc

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ void() EndRound =
207207
triggers = find(triggers, classname, "trigger_atroundend");
208208
}
209209
}
210-
211210
void(entity players) Zoning_SetFog;
212211
void() NewRound =
213212
{
@@ -284,26 +283,7 @@ void() NewRound =
284283
// Reset total repaired barricades for this round
285284
tempe.barricade_reward = 0;
286285

287-
string fog_value = "";
288-
if (rounds == dogRound && map_has_hellhounds) {
289-
roundtype = 2;
290-
291-
fog_value = strcat(game_modifier_hellhound_fog_color, "\n");
292-
stuffcmd(tempe, strcat("fog ", fog_value));
293-
} else {
294-
roundtype = 1;
295-
296-
if (has_zone_file) {
297-
Zoning_SetFog(tempe);
298-
} else {
299-
if (game_modifier_default_fog_color != "")
300-
fog_value = strcat(game_modifier_default_fog_color, "\n");
301-
else
302-
fog_value = "0 0 0 0 0\n";
303-
304-
stuffcmd(tempe, strcat("fog ", fog_value));
305-
}
306-
}
286+
Zoning_SetFog(tempe);
307287

308288
tempe = find(tempe, classname, "player");
309289
}

0 commit comments

Comments
 (0)