+#include "bobbing.qh"
#ifdef SVQC
.float height;
void func_bobbing_controller_think(entity this)
v = this.owner.destvec + this.owner.movedir * v_forward_y;
if(this.owner.classname == "func_bobbing") // don't brake stuff if the func_bobbing was killtarget'ed
// * 10 so it will arrive in 0.1 sec
- this.owner.velocity = (v - this.owner.SUB_ORIGIN) * 10;
+ this.owner.velocity = (v - this.owner.origin) * 10;
}
/*QUAKED spawnfunc_func_bobbing (0 .5 .8) ? X_AXIS Y_AXIS
this.active = ACTIVE_ACTIVE;
// damage when blocked
- this.blocked = generic_plat_blocked;
+ setblocked(this, generic_plat_blocked);
if(this.dmg && (this.message == ""))
this.message = " was squished";
if(this.dmg && (this.message2 == ""))
this.dmgtime2 = time;
// how far to bob
- if (this.spawnflags & 1) // X
+ if (this.spawnflags & BOBBING_XAXIS)
this.movedir = '1 0 0' * this.height;
- else if (this.spawnflags & 2) // Y
+ else if (this.spawnflags & BOBBING_YAXIS)
this.movedir = '0 1 0' * this.height;
else // Z
this.movedir = '0 0 1' * this.height;
controller.owner = this;
controller.nextthink = time + 1;
setthink(controller, func_bobbing_controller_think);
- this.SUB_NEXTTHINK = this.SUB_LTIME + 999999999;
- SUB_THINK(this, SUB_NullThink);
+ this.nextthink = this.ltime + 999999999;
+ setthink(this, SUB_NullThink);
// Savage: Reduce bandwith, critical on e.g. nexdm02
this.effects |= EF_LOWPRECISION;