X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmapobjects%2Ftrigger%2Fmulti.qc;fp=qcsrc%2Fcommon%2Fmapobjects%2Ftrigger%2Fmulti.qc;h=9ce5f52cea877d9a1f556c9fa1ee88b06027fe08;hp=5447b992c373e1c1694b7e5bacb926cd8953f2e9;hb=ca2b4af3846cb6e38d166006cc3b32c89cf99142;hpb=f53ede36a1898c157e840c96ffac2534ab3c8e31 diff --git a/qcsrc/common/mapobjects/trigger/multi.qc b/qcsrc/common/mapobjects/trigger/multi.qc index 5447b992c..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) { - SetResourceAmountExplicit(this, RESOURCE_HEALTH, this.max_health); + SetResourceExplicit(this, RES_HEALTH, this.max_health); this.takedamage = DAMAGE_YES; this.solid = SOLID_BBOX; } @@ -24,21 +24,12 @@ 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 } - // 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) { - SetResourceAmountExplicit(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;