From: Samual Date: Sun, 27 Mar 2011 08:18:28 +0000 (-0400) Subject: Finish up spawnfunc stuff X-Git-Tag: xonotic-v0.7.0~240^2~192 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a0c32a4f7b138c1e40011c57c6b8b2353f8f3337;p=xonotic%2Fxonotic-data.pk3dir.git Finish up spawnfunc stuff --- diff --git a/qcsrc/server/mutators/gamemode_ctf.qc b/qcsrc/server/mutators/gamemode_ctf.qc index a8edaa17a..2988f9bc8 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qc +++ b/qcsrc/server/mutators/gamemode_ctf.qc @@ -776,9 +776,9 @@ void FlagTouch() -// ============================================ -// Spawnfunc Section - aka "giant f%$!ing mess" -// ============================================ +// ========== +// Spawnfuncs +// ========== /*QUAKED spawnfunc_info_player_team1 (1 0 0) (-16 -16 -24) (16 16 24) CTF Starting point for a player in team one (Red). @@ -858,7 +858,6 @@ void spawnfunc_item_flag_team2() ctf_SetupFlag(0, self); } - /*QUAKED spawnfunc_ctf_team (0 .5 .8) (-16 -16 -24) (16 16 32) Team declaration for CTF gameplay, this allows you to decide what team names and control point models are used in your map. Note: If you use spawnfunc_ctf_team entities you must define at least 2! However, unlike domination, you don't need to make a blank one too. @@ -873,8 +872,12 @@ void spawnfunc_ctf_team() self.team = self.cnt + 1; } +// ============== +// Initialization +// ============== + // code from here on is just to support maps that don't have control point and team entities -void ctf_spawnteam (string teamname, float teamcolor) +void ctf_SpawnTeam (string teamname, float teamcolor) { local entity oldself; oldself = self; @@ -888,42 +891,29 @@ void ctf_spawnteam (string teamname, float teamcolor) self = oldself; } -// spawn some default teams if the map is not set up for ctf -void ctf_spawnteams() -{ - float numteams; - - numteams = 2;//cvar("g_ctf_default_teams"); - - ctf_spawnteam("Red", COLOR_TEAM1 - 1); - ctf_spawnteam("Blue", COLOR_TEAM2 - 1); -} - -void ctf_delayedinit() +void ctf_DelayedInit() { // if no teams are found, spawn defaults if(find(world, classname, "ctf_team") == world) { - ctf_spawnteam("Red", COLOR_TEAM1 - 1); - ctf_spawnteam("Blue", COLOR_TEAM2 - 1); + ctf_SpawnTeam("Red", COLOR_TEAM1 - 1); + ctf_SpawnTeam("Blue", COLOR_TEAM2 - 1); } - - ScoreRules_ctf(); } void ctf_Initialize() { - InitializeEntity(world, ctf_delayedinit, INITPRIO_GAMETYPE); flagcaptimerecord = stof(db_get(ServerProgsDB, strcat(GetMapname(), "/captimerecord/time"))); captureshield_min_negscore = autocvar_g_ctf_shield_min_negscore; captureshield_max_ratio = autocvar_g_ctf_shield_max_ratio; captureshield_force = autocvar_g_ctf_shield_force; - -//#NO AUTOCVARS START g_ctf_win_mode = cvar("g_ctf_win_mode"); -//#NO AUTOCVARS END + + ScoreRules_ctf(); + + InitializeEntity(world, ctf_DelayedInit, INITPRIO_GAMETYPE); }