X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Ftriggers%2Ffunc%2Frotating.qc;h=f34d41e2b02af8737d31d8c7e701de75dbe047e6;hp=2e3c7851a8f9090f926aa4d0cdc804e479d0a4b6;hb=cf1edea8694548556934b5b05f526bc192f576cb;hpb=28305c2245f99ca5ae21ea8858e05c6bb0a2000b diff --git a/qcsrc/common/triggers/func/rotating.qc b/qcsrc/common/triggers/func/rotating.qc index 2e3c7851a..f34d41e2b 100644 --- a/qcsrc/common/triggers/func/rotating.qc +++ b/qcsrc/common/triggers/func/rotating.qc @@ -1,21 +1,20 @@ #ifdef SVQC -void func_rotating_setactive(float astate) -{SELFPARAM(); - +void func_rotating_setactive(entity this, int astate) +{ if (astate == ACTIVE_TOGGLE) { - if(self.active == ACTIVE_ACTIVE) - self.active = ACTIVE_NOT; + if(this.active == ACTIVE_ACTIVE) + this.active = ACTIVE_NOT; else - self.active = ACTIVE_ACTIVE; + this.active = ACTIVE_ACTIVE; } else - self.active = astate; + this.active = astate; - if(self.active == ACTIVE_NOT) - self.avelocity = '0 0 0'; + if(this.active == ACTIVE_NOT) + this.avelocity = '0 0 0'; else - self.avelocity = self.pos1; + this.avelocity = this.pos1; } /*QUAKED spawnfunc_func_rotating (0 .5 .8) ? - - X_AXIS Y_AXIS @@ -26,51 +25,51 @@ dmg : Do this mutch dmg every .dmgtime intervall when blocked dmgtime : See above. */ -void spawnfunc_func_rotating() -{SELFPARAM(); - if (self.noise != "") +spawnfunc(func_rotating) +{ + if (this.noise != "") { - precache_sound(self.noise); - ambientsound(self.origin, self.noise, VOL_BASE, ATTEN_IDLE); + precache_sound(this.noise); + ambientsound(this.origin, this.noise, VOL_BASE, ATTEN_IDLE); } - self.active = ACTIVE_ACTIVE; - self.setactive = func_rotating_setactive; + this.active = ACTIVE_ACTIVE; + this.setactive = func_rotating_setactive; - if (!self.speed) - self.speed = 100; + if (!this.speed) + this.speed = 100; // FIXME: test if this turns the right way, then remove this comment (negate as needed) - if (self.spawnflags & 4) // X (untested) - self.avelocity = '0 0 1' * self.speed; + if (this.spawnflags & 4) // X (untested) + this.avelocity = '0 0 1' * this.speed; // FIXME: test if this turns the right way, then remove this comment (negate as needed) - else if (self.spawnflags & 8) // Y (untested) - self.avelocity = '1 0 0' * self.speed; + else if (this.spawnflags & 8) // Y (untested) + this.avelocity = '1 0 0' * this.speed; // FIXME: test if this turns the right way, then remove this comment (negate as needed) else // Z - self.avelocity = '0 1 0' * self.speed; + this.avelocity = '0 1 0' * this.speed; - self.pos1 = self.avelocity; + this.pos1 = this.avelocity; - if(self.dmg && (self.message == "")) - self.message = " was squished"; - if(self.dmg && (self.message2 == "")) - self.message2 = "was squished by"; + if(this.dmg && (this.message == "")) + this.message = " was squished"; + if(this.dmg && (this.message2 == "")) + this.message2 = "was squished by"; - if(self.dmg && (!self.dmgtime)) - self.dmgtime = 0.25; + if(this.dmg && (!this.dmgtime)) + this.dmgtime = 0.25; - self.dmgtime2 = time; + this.dmgtime2 = time; - if (!InitMovingBrushTrigger()) + if (!InitMovingBrushTrigger(this)) return; // no EF_LOWPRECISION here, as rounding angles is bad - self.blocked = generic_plat_blocked; + this.blocked = generic_plat_blocked; // wait for targets to spawn - self.SUB_NEXTTHINK = self.SUB_LTIME + 999999999; - self.SUB_THINK = SUB_NullThink; // for PushMove + this.SUB_NEXTTHINK = this.SUB_LTIME + 999999999; + SUB_THINK(this, SUB_NullThink); // for PushMove // TODO make a reset function for this one }