]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Onslaught: fix clientcamera support when round restarts
authorterencehill <piuntn@gmail.com>
Wed, 19 Oct 2016 01:11:41 +0000 (03:11 +0200)
committerterencehill <piuntn@gmail.com>
Wed, 19 Oct 2016 01:11:41 +0000 (03:11 +0200)
qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc

index f84a42eb6f567d5e760d89a738e6a4eac973ed2a..f1e25736970113e2409abd759aa83c12638c78b8 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;
@@ -1678,6 +1674,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 +2191,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);
 }