2 void func_rotating_setactive(entity this, int astate)
4 if (astate == ACTIVE_TOGGLE)
6 if(this.active == ACTIVE_ACTIVE)
7 this.active = ACTIVE_NOT;
9 this.active = ACTIVE_ACTIVE;
14 if(this.active == ACTIVE_NOT)
15 this.avelocity = '0 0 0';
17 this.avelocity = this.pos1;
20 /*QUAKED spawnfunc_func_rotating (0 .5 .8) ? - - X_AXIS Y_AXIS
21 Brush model that spins in place on one axis (default Z).
22 speed : speed to rotate (in degrees per second)
23 noise : path/name of looping .wav file to play.
24 dmg : Do this mutch dmg every .dmgtime intervall when blocked
28 spawnfunc(func_rotating)
32 precache_sound(this.noise);
33 ambientsound(this.origin, this.noise, VOL_BASE, ATTEN_IDLE);
36 this.active = ACTIVE_ACTIVE;
37 this.setactive = func_rotating_setactive;
41 // FIXME: test if this turns the right way, then remove this comment (negate as needed)
42 if (this.spawnflags & 4) // X (untested)
43 this.avelocity = '0 0 1' * this.speed;
44 // FIXME: test if this turns the right way, then remove this comment (negate as needed)
45 else if (this.spawnflags & 8) // Y (untested)
46 this.avelocity = '1 0 0' * this.speed;
47 // FIXME: test if this turns the right way, then remove this comment (negate as needed)
49 this.avelocity = '0 1 0' * this.speed;
51 this.pos1 = this.avelocity;
53 if(this.dmg && (this.message == ""))
54 this.message = " was squished";
55 if(this.dmg && (this.message2 == ""))
56 this.message2 = "was squished by";
59 if(this.dmg && (!this.dmgtime))
64 if (!InitMovingBrushTrigger(this))
66 // no EF_LOWPRECISION here, as rounding angles is bad
68 setblocked(this, generic_plat_blocked);
70 // wait for targets to spawn
71 this.SUB_NEXTTHINK = this.SUB_LTIME + 999999999;
72 SUB_THINK(this, SUB_NullThink); // for PushMove
74 // TODO make a reset function for this one