]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc
Merge branch 'master' into martin-t/damagetext
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / gamemodes / gamemode / onslaught / sv_onslaught.qc
index f84a42eb6f567d5e760d89a738e6a4eac973ed2a..f09e21fdbeeda068ddeea608219adfa84e13973e 100644 (file)
@@ -553,7 +553,7 @@ void ons_ControlPoint_Icon_BuildThink(entity this)
                if(IS_PLAYER(this.owner.ons_toucher))
                {
                        Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ONSLAUGHT_CAPTURE, this.owner.ons_toucher.netname, this.owner.message);
-                       Send_Notification(NOTIF_ALL_EXCEPT, this.owner.ons_toucher, MSG_CENTER, APP_TEAM_NUM(this.owner.ons_toucher.team, CENTER_ONS_CAPTURE), this.owner.message);
+                       Send_Notification(NOTIF_ALL_EXCEPT, this.owner.ons_toucher, MSG_CENTER, APP_TEAM_NUM(this.owner.ons_toucher.team, CENTER_ONS_CAPTURE_TEAM), this.owner.message);
                        Send_Notification(NOTIF_ONE, this.owner.ons_toucher, MSG_CENTER, CENTER_ONS_CAPTURE, this.owner.message);
                        PlayerScore_Add(this.owner.ons_toucher, SP_ONS_CAPS, 1);
                        PlayerTeamScore_AddScore(this.owner.ons_toucher, 10);
@@ -835,8 +835,6 @@ void ons_Generator_UpdateSprite(entity e)
 
 void ons_camSetup(entity this)
 {
-       if(cam) return;
-
        vector dir;
        vector ang = '0 0 0';
        vector best_ang = '0 0 0';
@@ -857,8 +855,6 @@ void ons_camSetup(entity this)
                if(ang.y == 360)
                        ang.y = 45;
        }
-
-       cam = new(objective_camera);
        cam.origin = this.origin;
        setorigin(cam, cam.origin);
        cam.angles = best_ang;
@@ -874,9 +870,9 @@ void ons_camSetup(entity this)
 
 void ons_GeneratorDamage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
 {
-       if(damage <= 0) { return; }
-       if(warmup_stage || gameover) { return; }
-       if(!round_handler_IsRoundStarted()) { return; }
+       if(damage <= 0) return;
+       if(warmup_stage || game_stopped) return;
+       if(!round_handler_IsRoundStarted()) return;
 
        if (attacker != this)
        {
@@ -959,7 +955,7 @@ void ons_GeneratorDamage(entity this, entity inflictor, entity attacker, float d
 void ons_GeneratorThink(entity this)
 {
        this.nextthink = time + GEN_THINKRATE;
-       if (!gameover)
+       if (!game_stopped)
        {
                if(!this.isshielded && this.wait < time)
                {
@@ -983,7 +979,8 @@ void ons_GeneratorReset(entity this)
        this.lasthealth = this.max_health = this.health = autocvar_g_onslaught_gen_health;
        this.takedamage = DAMAGE_AIM;
        this.bot_attack = true;
-       IL_PUSH(g_bot_targets, this);
+       if(!IL_CONTAINS(g_bot_targets, this))
+               IL_PUSH(g_bot_targets, this);
        this.iscaptured = true;
        this.islinked = true;
        this.isshielded = true;
@@ -1198,6 +1195,7 @@ bool Onslaught_CheckWinner()
                nades_Clear(it);
        });
 
+       game_stopped = true;
        return 1;
 }
 
@@ -1641,7 +1639,7 @@ bool ons_Teleport(entity player, entity tele_target, float range, bool tele_effe
 
                loc += tele_target.origin + '0 0 128' * iteration_scale;
 
-               tracebox(loc, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), loc, MOVE_NORMAL, player);
+               tracebox(loc, STAT(PL_MIN, player), STAT(PL_MAX, player), loc, MOVE_NORMAL, player);
                if(trace_fraction == 1.0 && !trace_startsolid)
                {
                        traceline(tele_target.origin, loc, MOVE_NOMONSTERS, tele_target); // double check to make sure we're not spawning outside the NULL
@@ -1678,6 +1676,7 @@ MUTATOR_HOOKFUNCTION(ons, reset_map_global)
                STAT(ROUNDLOST, it) = false;
                it.ons_deathloc = '0 0 0';
                PutClientInServer(it);
+               it.clientcamera = it;
        });
        return false;
 }
@@ -1759,7 +1758,7 @@ MUTATOR_HOOKFUNCTION(ons, PlayerSpawn)
                                iteration_scale -= i / 10;
                                loc = closest_target.origin + '0 0 96' * iteration_scale;
                                loc += ('0 1 0' * random()) * 128 * iteration_scale;
-                               tracebox(loc, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), loc, MOVE_NORMAL, player);
+                               tracebox(loc, STAT(PL_MIN, player), STAT(PL_MAX, player), loc, MOVE_NORMAL, player);
                                if(trace_fraction == 1.0 && !trace_startsolid)
                                {
                                        traceline(closest_target.origin, loc, MOVE_NOMONSTERS, closest_target); // double check to make sure we're not spawning outside the NULL
@@ -1810,7 +1809,7 @@ MUTATOR_HOOKFUNCTION(ons, PlayerSpawn)
                                iteration_scale -= i / 10;
                                loc = closest_target.origin + '0 0 128' * iteration_scale;
                                loc += ('0 1 0' * random()) * 256 * iteration_scale;
-                               tracebox(loc, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), loc, MOVE_NORMAL, player);
+                               tracebox(loc, STAT(PL_MIN, player), STAT(PL_MAX, player), loc, MOVE_NORMAL, player);
                                if(trace_fraction == 1.0 && !trace_startsolid)
                                {
                                        traceline(closest_target.origin, loc, MOVE_NOMONSTERS, closest_target); // double check to make sure we're not spawning outside the NULL
@@ -2023,7 +2022,7 @@ MUTATOR_HOOKFUNCTION(ons, SV_ParseClientCommand)
 
 MUTATOR_HOOKFUNCTION(ons, PlayerUseKey)
 {
-       if(MUTATOR_RETURNVALUE || gameover) { return false; }
+       if(MUTATOR_RETURNVALUE || game_stopped) return false;
 
        entity player = M_ARGV(0, entity);
 
@@ -2194,5 +2193,7 @@ void ons_Initialize()
        g_onslaught = true;
        ons_captureshield_force = autocvar_g_onslaught_shield_force;
 
+       cam = new(objective_camera);
+
        InitializeEntity(NULL, ons_DelayedInit, INITPRIO_GAMETYPE);
 }