]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/gamemodes/gamemode/onslaught/cl_generator.qc
Fix #1810 generator doesn't show any explosion effect when it gets destroyed
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / gamemodes / gamemode / onslaught / cl_generator.qc
index 2b9470f7750ab2b9fecac82a5abe51590811e6bb..54ced2fb1a9a9634ce389f4730d78d4694334270 100644 (file)
@@ -143,11 +143,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 +205,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)