X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Ftriggers%2Ftriggers.qc;h=73c5c49651259aaa9376945cc6e1c080df0bb91b;hp=1e7715a91b58a70ef8472f980ea8a9a094c16214;hb=cd508c593bc52d211c1675e1e52ae741cc487ab3;hpb=02e0727816326407cc681dd2d12c67d157e618cf diff --git a/qcsrc/common/triggers/triggers.qc b/qcsrc/common/triggers/triggers.qc index 1e7715a91..73c5c4965 100644 --- a/qcsrc/common/triggers/triggers.qc +++ b/qcsrc/common/triggers/triggers.qc @@ -3,7 +3,7 @@ void SUB_DontUseTargets() { } void() SUB_UseTargets; void DelayThink() -{ +{SELFPARAM(); activator = self.enemy; SUB_UseTargets (); remove(self); @@ -22,7 +22,7 @@ void FixSize(entity e) #ifdef SVQC void trigger_common_write(bool withtarget) -{ +{SELFPARAM(); WriteByte(MSG_ENTITY, self.warpzone_isboxy); WriteByte(MSG_ENTITY, self.scale); @@ -59,7 +59,7 @@ void trigger_common_write(bool withtarget) #elif defined(CSQC) void trigger_common_read(bool withtarget) -{ +{SELFPARAM(); self.warpzone_isboxy = ReadByte(); self.scale = ReadByte(); @@ -96,7 +96,7 @@ void trigger_common_read(bool withtarget) } void trigger_remove_generic() -{ +{SELFPARAM(); if(self.target) { strunzone(self.target); } self.target = string_null; @@ -137,8 +137,8 @@ match (string)self.target and call their .use function ============================== */ void SUB_UseTargets() -{ - entity t, stemp, otemp, act; +{SELFPARAM(); + entity t, otemp, act; string s; float i; @@ -173,7 +173,7 @@ void SUB_UseTargets() { centerprint(activator, self.message); if (self.noise == "") - play2(activator, "misc/talk.wav"); + play2(activator, SND(TALK)); } // @@ -191,10 +191,9 @@ void SUB_UseTargets() // fire targets // act = activator; - stemp = self; otemp = other; - if(stemp.target_random) + if(this.target_random) RandomSelection_Init(); for(i = 0; i < 4; ++i) @@ -202,10 +201,10 @@ void SUB_UseTargets() switch(i) { default: - case 0: s = stemp.target; break; - case 1: s = stemp.target2; break; - case 2: s = stemp.target3; break; - case 3: s = stemp.target4; break; + case 0: s = this.target; break; + case 1: s = this.target2; break; + case 2: s = this.target3; break; + case 3: s = this.target4; break; } if (s != "") { @@ -215,7 +214,7 @@ void SUB_UseTargets() for(t = world; (t = find(t, targetname, s)); ) if(t.use) { - if(stemp.target_random) + if(this.target_random) { RandomSelection_Add(t, 0, string_null, 1, 0); } @@ -223,8 +222,8 @@ void SUB_UseTargets() { if (t.classname == "func_clientwall" || t.classname == "func_clientillusionary") t.antiwall_flag = aw_flag; - self = t; - other = stemp; + setself(t); + other = this; activator = act; self.use(); } @@ -232,22 +231,22 @@ void SUB_UseTargets() } } - if(stemp.target_random && RandomSelection_chosen_ent) + if(this.target_random && RandomSelection_chosen_ent) { - self = RandomSelection_chosen_ent; - other = stemp; + setself(RandomSelection_chosen_ent); + other = this; activator = act; self.use(); } activator = act; - self = stemp; + setself(this); other = otemp; } #ifdef CSQC void trigger_touch_generic(void() touchfunc) -{ +{SELFPARAM(); entity e; for(e = findradius((self.absmin + self.absmax) * 0.5, vlen(self.absmax - self.absmin) * 0.5 + 1); e; e = e.chain) if(e.isplayermodel || e.classname == "csqcprojectile") @@ -267,7 +266,7 @@ void trigger_touch_generic(void() touchfunc) } } void trigger_draw_generic() -{ +{SELFPARAM(); float dt = time - self.move_time; self.move_time = time; if(dt <= 0) { return; }