]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/gamemodes/gamemode/onslaught/cl_generator.qc
Merge branch 'master' into terencehill/gameover_stuff
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / gamemodes / gamemode / onslaught / cl_generator.qc
index 2b9470f7750ab2b9fecac82a5abe51590811e6bb..ac7a066ab17032c3fb0ae3733bdd8ead99c686c8 100644 (file)
@@ -14,6 +14,7 @@ void ons_generator_ray_draw(entity this)
 
        if(this.count > 10)
        {
+               IL_REMOVE(g_drawables, this);
                delete(this);
                return;
        }
@@ -143,11 +144,17 @@ void generator_damage(entity this, float hp)
        setsize(this, GENERATOR_MIN, GENERATOR_MAX);
 }
 
-void generator_construct(entity this)
+void generator_construct(entity this, bool isnew)
 {
        this.netname = "Generator";
        this.classname = "onslaught_generator";
 
+       if(isnew)
+       {
+               IL_PUSH(g_onsgenerators, this);
+               IL_PUSH(g_drawables, this);
+       }
+
        setorigin(this, this.origin);
        setmodel(this, MDL_ONS_GEN);
        setsize(this, GENERATOR_MIN, GENERATOR_MAX);
@@ -199,7 +206,7 @@ NET_HANDLE(ENT_CLIENT_GENERATOR, bool isnew)
                        this.count = 40;
 
                generator_changeteam(this);
-               generator_construct(this);
+               generator_construct(this, isnew);
        }
 
        if(sf & GSF_STATUS)