X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fgamemodes%2Fgamemode%2Fonslaught%2Fcl_generator.qc;h=d8d28488abff4064c58969bc126b4b6f01d107b9;hb=57a5521ab909e321deef5e56ee807cf5df12476b;hp=9d12c5548e6d4eafd4abdb336b6aa7208274bda3;hpb=6c27fe90b0454df3dbf7b098bc554fcb5eaa75d0;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 9d12c5548..d8d28488a 100644 --- a/qcsrc/common/gamemodes/gamemode/onslaught/cl_generator.qc +++ b/qcsrc/common/gamemodes/gamemode/onslaught/cl_generator.qc @@ -48,10 +48,10 @@ void generator_draw(entity this) if(time < this.move_time) return; - if(GetResourceAmount(this, RESOURCE_HEALTH) > 0) + if(GetResource(this, RES_HEALTH) > 0) { // damaged fx (less probable the more damaged is the generator) - if(random() < 0.9 - GetResourceAmount(this, RESOURCE_HEALTH) / this.max_health) + if(random() < 0.9 - GetResource(this, RES_HEALTH) / this.max_health) if(random() < 0.01) { pointparticles(EFFECT_ELECTRO_BALLEXPLODE, this.origin + randompos('-50 -50 -20', '50 50 50'), '0 0 0', 1); @@ -157,10 +157,10 @@ void generator_construct(entity this, bool isnew) setorigin(this, this.origin); setmodel(this, MDL_ONS_GEN); + this.solid = SOLID_BBOX; // before setsize to ensure area grid linking setsize(this, GENERATOR_MIN, GENERATOR_MAX); set_movetype(this, MOVETYPE_NOCLIP); - this.solid = SOLID_BBOX; set_movetype(this, MOVETYPE_NOCLIP); this.move_time = time; this.drawmask = MASK_NORMAL; @@ -195,7 +195,7 @@ NET_HANDLE(ENT_CLIENT_GENERATOR, bool isnew) this.origin = ReadVector(); setorigin(this, this.origin); - SetResourceAmountExplicit(this, RESOURCE_HEALTH, ReadByte()); + SetResourceExplicit(this, RES_HEALTH, ReadByte()); this.max_health = ReadByte(); this.count = ReadByte(); this.team = ReadByte(); @@ -219,9 +219,9 @@ NET_HANDLE(ENT_CLIENT_GENERATOR, bool isnew) _tmp = ReadByte(); - if(_tmp != GetResourceAmount(this, RESOURCE_HEALTH)) + if(_tmp != GetResource(this, RES_HEALTH)) generator_damage(this, _tmp); - SetResourceAmountExplicit(this, RESOURCE_HEALTH, _tmp); + SetResourceExplicit(this, RES_HEALTH, _tmp); } }