X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmapobjects%2Ftrigger%2Fmulti.qc;h=c71dc3794822d5f41094411a7a6f3242b904219f;hb=e0012447bfce1b551df3dc01b043655aa93dafad;hp=accfbe8ac47b057d745a4542cb214ae10a66acbd;hpb=5aab6120acfc624751d20a695d1b911b3e919831;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/mapobjects/trigger/multi.qc b/qcsrc/common/mapobjects/trigger/multi.qc index accfbe8ac4..c71dc37948 100644 --- a/qcsrc/common/mapobjects/trigger/multi.qc +++ b/qcsrc/common/mapobjects/trigger/multi.qc @@ -7,7 +7,7 @@ void multi_wait(entity this) { if (this.max_health) { - this.health = this.max_health; + SetResourceExplicit(this, RES_HEALTH, this.max_health); this.takedamage = DAMAGE_YES; this.solid = SOLID_BBOX; } @@ -24,7 +24,7 @@ void multi_trigger(entity this) return; // allready been triggered } - if(this.spawnflags & ONLY_PLAYERS && !IS_PLAYER(this.enemy)) + if((this.spawnflags & ONLY_PLAYERS) && !IS_PLAYER(this.enemy)) { return; // only players } @@ -120,8 +120,8 @@ void multi_eventdamage(entity this, entity inflictor, entity attacker, float dam if(this.team) if(((this.spawnflags & INVERT_TEAMS) == 0) == (this.team != attacker.team)) return; - this.health = this.health - damage; - if (this.health <= 0) + TakeResource(this, RES_HEALTH, damage); + if (GetResource(this, RES_HEALTH) <= 0) { this.enemy = attacker; this.goalentity = inflictor; @@ -135,7 +135,7 @@ void multi_reset(entity this) settouch(this, multi_touch); if (this.max_health) { - this.health = this.max_health; + SetResourceExplicit(this, RES_HEALTH, this.max_health); this.takedamage = DAMAGE_YES; this.solid = SOLID_BBOX; } @@ -181,12 +181,12 @@ spawnfunc(trigger_multiple) this.team_saved = this.team; IL_PUSH(g_saved_team, this); - if (this.health) + if (GetResource(this, RES_HEALTH)) { if (this.spawnflags & SPAWNFLAG_NOTOUCH) objerror (this, "health and notouch don't make sense\n"); this.canteamdamage = true; - this.max_health = this.health; + this.max_health = GetResource(this, RES_HEALTH); this.event_damage = multi_eventdamage; this.takedamage = DAMAGE_YES; this.solid = SOLID_BBOX;