X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fgamemodes%2Fgamemode%2Fonslaught%2Fcl_generator.qc;h=ac7a066ab17032c3fb0ae3733bdd8ead99c686c8;hb=34e7f534e2015466228eb3a78c9857741b736dca;hp=03e81f4bdea092deee9f965d104cf4f3d4c8f2af;hpb=985f81ea5425d2e3d2382a6b13397976ca15783a;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/gamemodes/gamemode/onslaught/cl_generator.qc b/qcsrc/common/gamemodes/gamemode/onslaught/cl_generator.qc index 03e81f4bd..ac7a066ab 100644 --- a/qcsrc/common/gamemodes/gamemode/onslaught/cl_generator.qc +++ b/qcsrc/common/gamemodes/gamemode/onslaught/cl_generator.qc @@ -14,7 +14,8 @@ void ons_generator_ray_draw(entity this) if(this.count > 10) { - remove(this); + IL_REMOVE(g_drawables, this); + delete(this); return; } @@ -33,13 +34,13 @@ void ons_generator_ray_spawn(vector org) setmodel(e, MDL_ONS_RAY); setorigin(e, org); e.angles = randomvec() * 360; - e.move_origin = org; - e.movetype = MOVETYPE_NONE; + set_movetype(e, MOVETYPE_NONE); e.alpha = 0; e.scale = random() * 5 + 8; e.move_time = time + 0.05; e.drawmask = MASK_NORMAL; e.draw = ons_generator_ray_draw; + IL_PUSH(g_drawables, e); } void generator_draw(entity this) @@ -143,19 +144,24 @@ 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); - this.move_movetype = MOVETYPE_NOCLIP; + set_movetype(this, MOVETYPE_NOCLIP); this.solid = SOLID_BBOX; - this.movetype = MOVETYPE_NOCLIP; - this.move_origin = this.origin; + set_movetype(this, MOVETYPE_NOCLIP); this.move_time = time; this.drawmask = MASK_NORMAL; this.alpha = 1; @@ -200,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)