X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmapobjects%2Ftrigger%2Fmulti.qc;h=9ce5f52cea877d9a1f556c9fa1ee88b06027fe08;hb=dba16d1e3e79360f1167ec2965a551e56c3bdcf2;hp=181cde6fdcb579e1aeefbaa9c66d83016f7e806c;hpb=2e05a1d8421ee2cbb604582d644133500aae2450;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/mapobjects/trigger/multi.qc b/qcsrc/common/mapobjects/trigger/multi.qc index 181cde6fd..9ce5f52ce 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) { - SetResourceAmount(this, RESOURCE_HEALTH, this.max_health); + SetResourceExplicit(this, RES_HEALTH, this.max_health); this.takedamage = DAMAGE_YES; this.solid = SOLID_BBOX; } @@ -29,16 +29,7 @@ void multi_trigger(entity this) return; // only players } - // TODO: restructure this so that trigger_secret is more independent - if (this.classname == "trigger_secret") - { - if (!IS_PLAYER(this.enemy)) - return; - found_secrets = found_secrets + 1; - WriteByte (MSG_ALL, SVC_FOUNDSECRET); - } - - if (this.noise) + if (this.noise && this.noise != "") { _sound (this.enemy, CH_TRIGGER, this.noise, VOL_BASE, ATTEN_NORM); } @@ -120,8 +111,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; - TakeResource(this, RESOURCE_HEALTH, damage); - if (GetResourceAmount(this, RESOURCE_HEALTH) <= 0) + TakeResource(this, RES_HEALTH, damage); + if (GetResource(this, RES_HEALTH) <= 0) { this.enemy = attacker; this.goalentity = inflictor; @@ -135,7 +126,7 @@ void multi_reset(entity this) settouch(this, multi_touch); if (this.max_health) { - SetResourceAmount(this, RESOURCE_HEALTH, this.max_health); + SetResourceExplicit(this, RES_HEALTH, this.max_health); this.takedamage = DAMAGE_YES; this.solid = SOLID_BBOX; } @@ -167,7 +158,7 @@ spawnfunc(trigger_multiple) else if (this.sounds == 3) this.noise = "misc/trigger1.wav"; - if(this.noise) + if(this.noise && this.noise != "") precache_sound(this.noise); if (!this.wait) @@ -176,17 +167,20 @@ spawnfunc(trigger_multiple) this.wait = 0; this.use = multi_use; + if(this.wait == -1 && autocvar_sv_q3defragcompat) + this.wait = 0.1; // compatibility for q3df: "instant" return + EXACTTRIGGER_INIT; this.team_saved = this.team; IL_PUSH(g_saved_team, this); - if (GetResourceAmount(this, RESOURCE_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 = GetResourceAmount(this, RESOURCE_HEALTH); + this.max_health = GetResource(this, RES_HEALTH); this.event_damage = multi_eventdamage; this.takedamage = DAMAGE_YES; this.solid = SOLID_BBOX;