]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc
Merge branch 'master' into Mario/intrusive_2
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / gamemodes / gamemode / onslaught / sv_onslaught.qc
index f84a42eb6f567d5e760d89a738e6a4eac973ed2a..572611c5d3f874169b7312c224888758d64f26a3 100644 (file)
@@ -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;
@@ -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;
@@ -1678,6 +1675,7 @@ MUTATOR_HOOKFUNCTION(ons, reset_map_global)
                STAT(ROUNDLOST, it) = false;
                it.ons_deathloc = '0 0 0';
                PutClientInServer(it);
+               it.clientcamera = it;
        });
        return false;
 }
@@ -2194,5 +2192,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);
 }