#define FOR_EACH_SPEC(v) FOR_EACH_CLIENT(v) if not(IS_PLAYER(v)) // Samual: shouldn't this be IS_SPEC(v)? and rather create a separate macro to include observers too
#define FOR_EACH_REALPLAYER(v) FOR_EACH_REALCLIENT(v) if(IS_PLAYER(v))
+#define FOR_EACH_MONSTER(v) for(v = world; (v = findflags(v, flags, FL_MONSTER)) != world; )
+
#define CENTER_OR_VIEWOFS(ent) (ent.origin + (IS_PLAYER(ent) ? ent.view_ofs : ((ent.mins + ent.maxs) * 0.5)))
// copies a string to a tempstring (so one can strunzone it)
start_ammo_fuel = cvar("g_start_ammo_fuel");
}
- if (inWarmupStage)
+ if (warmup_stage)
{
warmup_start_ammo_shells = start_ammo_shells;
warmup_start_ammo_nails = start_ammo_nails;
g_bugrigs_speed_pow = cvar("g_bugrigs_speed_pow");
g_bugrigs_steer = cvar("g_bugrigs_steer");
+ monster_skill = cvar("g_monsters_skill");
+
g_minstagib = cvar("g_minstagib");
sv_clones = cvar("sv_clones");
sv_autotaunt = cvar("sv_autotaunt");
sv_taunt = cvar("sv_taunt");
- inWarmupStage = cvar("g_warmup");
+ warmup_stage = cvar("g_warmup");
g_warmup_limit = cvar("g_warmup_limit");
g_warmup_allguns = cvar("g_warmup_allguns");
g_warmup_allow_timeout = cvar("g_warmup_allow_timeout");
if ((g_race && g_race_qualifying == 2) || g_arena || g_assault || cvar("g_campaign"))
- inWarmupStage = 0; // these modes cannot work together, sorry
+ warmup_stage = 0; // these modes cannot work together, sorry
g_pickup_respawntime_weapon = cvar("g_pickup_respawntime_weapon");
g_pickup_respawntime_superweapon = cvar("g_pickup_respawntime_superweapon");
if(!g_weapon_stay)
g_weapon_stay = cvar("g_weapon_stay");
- if not(inWarmupStage)
+ if not(warmup_stage)
game_starttime = time + cvar("g_start_delay");
readplayerstartcvars();
// these can be traceLINES as we already verified the starting box
mstart = start + 0.5 * (e.mins + e.maxs);
traceline(mstart, mstart + '1 0 0' * delta_x, MOVE_NORMAL, e);
- if (trace_fraction >= 1)
+ if (trace_fraction >= 1 || trace_dphittexturename == "common/caulk")
continue;
traceline(mstart, mstart - '1 0 0' * delta_x, MOVE_NORMAL, e);
- if (trace_fraction >= 1)
+ if (trace_fraction >= 1 || trace_dphittexturename == "common/caulk")
continue;
traceline(mstart, mstart + '0 1 0' * delta_y, MOVE_NORMAL, e);
- if (trace_fraction >= 1)
+ if (trace_fraction >= 1 || trace_dphittexturename == "common/caulk")
continue;
traceline(mstart, mstart - '0 1 0' * delta_y, MOVE_NORMAL, e);
- if (trace_fraction >= 1)
+ if (trace_fraction >= 1 || trace_dphittexturename == "common/caulk")
continue;
traceline(mstart, mstart + '0 0 1' * delta_z, MOVE_NORMAL, e);
- if (trace_fraction >= 1)
+ if (trace_fraction >= 1 || trace_dphittexturename == "common/caulk")
continue;
- // rule 4: we must "see" some spawnpoint
+ // rule 4: we must "see" some spawnpoint or item
for(sp = world; (sp = find(sp, classname, "info_player_deathmatch")); )
if(checkpvs(mstart, sp))
- break;
+ if((traceline(mstart, sp.origin, MOVE_NORMAL, e), trace_fraction) >= 1)
+ break;
if(!sp)
{
for(sp = world; (sp = findflags(sp, flags, FL_ITEM)); )
if(checkpvs(mstart, sp))
- break;
+ if((traceline(mstart, sp.origin + (sp.mins + sp.maxs) * 0.5, MOVE_NORMAL, e), trace_fraction) >= 1)
+ break;
if(!sp)
continue;
}