X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmapobjects%2Ffunc%2Fbreakable.qc;h=e92af677cc565dabd71a4177c94b17983f0ab6a0;hb=3a9017e6791a5dd7de4ba669c3b1ff08d4347a5b;hp=cb17ac442cb4244aa71b708e6c7c27deaf220bb4;hpb=62d736d8c3a51baf5fa3a4265e39a2b773704a91;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/mapobjects/func/breakable.qc b/qcsrc/common/mapobjects/func/breakable.qc index cb17ac442..e92af677c 100644 --- a/qcsrc/common/mapobjects/func/breakable.qc +++ b/qcsrc/common/mapobjects/func/breakable.qc @@ -83,7 +83,7 @@ void func_breakable_colormod(entity this) float h; if (!(this.spawnflags & BREAKABLE_INDICATE_DAMAGE)) return; - h = GetResourceAmount(this, RESOURCE_HEALTH) / this.max_health; + h = GetResource(this, RES_HEALTH) / this.max_health; if(h < 0.25) this.colormod = '1 0 0'; else if(h <= 0.75) @@ -129,7 +129,7 @@ void func_breakable_look_restore(entity this) void func_breakable_behave_destroyed(entity this) { - SetResourceAmountExplicit(this, RESOURCE_HEALTH, this.max_health); + SetResourceExplicit(this, RES_HEALTH, this.max_health); this.takedamage = DAMAGE_NO; if(this.bot_attack) IL_REMOVE(g_bot_targets, this); @@ -157,11 +157,11 @@ void func_breakable_think(entity this) void func_breakable_destroy(entity this, entity actor, entity trigger); void func_breakable_behave_restore(entity this) { - SetResourceAmountExplicit(this, RESOURCE_HEALTH, this.max_health); + SetResourceExplicit(this, RES_HEALTH, this.max_health); if(this.sprite) { WaypointSprite_UpdateMaxHealth(this.sprite, this.max_health); - WaypointSprite_UpdateHealth(this.sprite, GetResourceAmount(this, RESOURCE_HEALTH)); + WaypointSprite_UpdateHealth(this.sprite, GetResource(this, RES_HEALTH)); } if(!(this.spawnflags & BREAKABLE_NODAMAGE)) { @@ -272,15 +272,15 @@ void func_breakable_damage(entity this, entity inflictor, entity attacker, float if(attacker.team == this.team) return; this.pain_finished = time; - TakeResource(this, RESOURCE_HEALTH, damage); + TakeResource(this, RES_HEALTH, damage); if(this.sprite) { WaypointSprite_Ping(this.sprite); - WaypointSprite_UpdateHealth(this.sprite, GetResourceAmount(this, RESOURCE_HEALTH)); + WaypointSprite_UpdateHealth(this.sprite, GetResource(this, RES_HEALTH)); } func_breakable_colormod(this); - if(GetResourceAmount(this, RESOURCE_HEALTH) <= 0) + if(GetResource(this, RES_HEALTH) <= 0) { debrisforce = force; @@ -315,9 +315,9 @@ void func_breakable_reset(entity this) spawnfunc(func_breakable) { float n, i; - if(!GetResourceAmount(this, RESOURCE_HEALTH)) - SetResourceAmountExplicit(this, RESOURCE_HEALTH, 100); - this.max_health = GetResourceAmount(this, RESOURCE_HEALTH); + if(!GetResource(this, RES_HEALTH)) + SetResourceExplicit(this, RES_HEALTH, 100); + this.max_health = GetResource(this, RES_HEALTH); // yes, I know, MOVETYPE_NONE is not available here, not that one would want it here anyway if(!this.debrismovetype) this.debrismovetype = MOVETYPE_BOUNCE; @@ -343,7 +343,7 @@ spawnfunc(func_breakable) this.dmg_force = 200; this.mdl = this.model; - SetBrushEntityModel(this); + SetBrushEntityModel(this, true); if(this.spawnflags & BREAKABLE_NODAMAGE) this.use = func_breakable_destroy;