X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Ftriggers%2Ffunc%2Fdoor_rotating.qc;h=77061ecb3e626c6516c2e3d69849fa3909cecff1;hp=e01a7e73e299e6288652471a283eb9a4cb03a25c;hb=1add7fc6b9e512dcfcfd3180505046449ac782cd;hpb=32ca966802c45c4c231210c2d8776bc3f4135dc2 diff --git a/qcsrc/common/triggers/func/door_rotating.qc b/qcsrc/common/triggers/func/door_rotating.qc index e01a7e73e..77061ecb3 100644 --- a/qcsrc/common/triggers/func/door_rotating.qc +++ b/qcsrc/common/triggers/func/door_rotating.qc @@ -27,17 +27,17 @@ START_OPEN causes the door to move to its destination when spawned, and operate FIXME: only one sound set available at the time being */ -void door_rotating_reset() -{SELFPARAM(); - self.angles = self.pos1; - self.avelocity = '0 0 0'; - self.state = STATE_BOTTOM; - self.think = func_null; - self.nextthink = 0; +void door_rotating_reset(entity this) +{ + this.angles = this.pos1; + this.avelocity = '0 0 0'; + this.state = STATE_BOTTOM; + this.think = func_null; + this.nextthink = 0; } -void door_rotating_init_startopen() -{SELFPARAM(); +void door_rotating_init_startopen(entity this) +{ self.angles = self.movedir; self.pos2 = '0 0 0'; self.pos1 = self.movedir; @@ -47,80 +47,80 @@ void door_rotating_init_startopen() spawnfunc(func_door_rotating) { - //if (!self.deathtype) // map makers can override this - // self.deathtype = " got in the way"; + //if (!this.deathtype) // map makers can override this + // this.deathtype = " got in the way"; // I abuse "movedir" for denoting the axis for now - if (self.spawnflags & 64) // X (untested) - self.movedir = '0 0 1'; - else if (self.spawnflags & 128) // Y (untested) - self.movedir = '1 0 0'; + if (this.spawnflags & 64) // X (untested) + this.movedir = '0 0 1'; + else if (this.spawnflags & 128) // Y (untested) + this.movedir = '1 0 0'; else // Z - self.movedir = '0 1 0'; + this.movedir = '0 1 0'; - if (self.angles_y==0) self.angles_y = 90; + if (this.angles_y==0) this.angles_y = 90; - self.movedir = self.movedir * self.angles_y; - self.angles = '0 0 0'; + this.movedir = this.movedir * this.angles_y; + this.angles = '0 0 0'; - self.max_health = self.health; - self.avelocity = self.movedir; - if (!InitMovingBrushTrigger()) + this.max_health = this.health; + this.avelocity = this.movedir; + if (!InitMovingBrushTrigger(this)) return; - self.velocity = '0 0 0'; - //self.effects |= EF_LOWPRECISION; - self.classname = "door_rotating"; + this.velocity = '0 0 0'; + //this.effects |= EF_LOWPRECISION; + this.classname = "door_rotating"; - self.blocked = door_blocked; - self.use = door_use; + this.blocked = door_blocked; + this.use = door_use; - if(self.spawnflags & 8) - self.dmg = 10000; + if(this.spawnflags & 8) + this.dmg = 10000; - 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.sounds > 0) + if (this.sounds > 0) { precache_sound ("plats/medplat1.wav"); precache_sound ("plats/medplat2.wav"); - self.noise2 = "plats/medplat1.wav"; - self.noise1 = "plats/medplat2.wav"; + this.noise2 = "plats/medplat1.wav"; + this.noise1 = "plats/medplat2.wav"; } - if (!self.speed) - self.speed = 50; - if (!self.wait) - self.wait = 1; - self.lip = 0; // self.lip is used to remember reverse opening direction for door_rotating + if (!this.speed) + this.speed = 50; + if (!this.wait) + this.wait = 1; + this.lip = 0; // this.lip is used to remember reverse opening direction for door_rotating - self.pos1 = '0 0 0'; - self.pos2 = self.movedir; + this.pos1 = '0 0 0'; + this.pos2 = this.movedir; // DOOR_START_OPEN is to allow an entity to be lighted in the closed position // but spawn in the open position - if (self.spawnflags & DOOR_START_OPEN) - InitializeEntity(self, door_rotating_init_startopen, INITPRIO_SETLOCATION); + if (this.spawnflags & DOOR_START_OPEN) + InitializeEntity(this, door_rotating_init_startopen, INITPRIO_SETLOCATION); - self.state = STATE_BOTTOM; + this.state = STATE_BOTTOM; - if (self.health) + if (this.health) { - self.takedamage = DAMAGE_YES; - self.event_damage = door_damage; + this.takedamage = DAMAGE_YES; + this.event_damage = door_damage; } - if (self.items) - self.wait = -1; + if (this.items) + this.wait = -1; - self.touch = door_touch; + settouch(this, door_touch); // LinkDoors can't be done until all of the doors have been spawned, so // the sizes can be detected properly. - InitializeEntity(self, LinkDoors, INITPRIO_LINKDOORS); + InitializeEntity(this, LinkDoors, INITPRIO_LINKDOORS); - self.reset = door_rotating_reset; + this.reset = door_rotating_reset; } #endif