float CheatImpulse(entity this, int imp) { return 0; }
float CheatCommand(entity this, int argc) { return 0; }
-float CheatFrame() { return 0; }
+float CheatFrame(entity this) { return 0; }
void CheatInit() { cheatcount_total = world.cheatcount; }
void CheatShutdown() { }
void Drag_MoveDrag(entity from, entity to) { }
END_CHEAT_FUNCTION();
}
-void DragBox_Think();
+void DragBox_Think(entity this);
float drag_lastcnt;
float CheatCommand(entity this, int argc)
{
{
float effectnum, f;
vector start, end;
- entity oldself;
case "pointparticles":
IS_CHEAT(this, 0, argc, 0);
{
start = '0 0 0';
effectnum = 0;
- for(oldself = world; (oldself = find(oldself, classname, "dragbox_box")); )
+ for(entity ent = world; (ent = find(ent, classname, "dragbox_box")); )
{
- if(e.cnt <= 0 && oldself.cnt == 0 || e.cnt == oldself.cnt)
+ if(e.cnt <= 0 && ent.cnt == 0 || e.cnt == ent.cnt)
{
- start = start + oldself.origin;
+ start = start + ent.origin;
++effectnum;
}
}
// these need race_place
// counting...
effectnum = 1;
- for(oldself = world; (oldself = find(oldself, classname, "dragpoint")); )
- if(oldself.cnt == 0)
+ for(entity ent = world; (ent = find(ent, classname, "dragpoint")); )
+ if(ent.cnt == 0)
{
- if(vlen(oldself.origin - start) < vlen(e.origin - start))
+ if(vlen2(ent.origin - start) < vlen2(e.origin - start))
++effectnum;
- else if(vlen(oldself.origin - start) == vlen(e.origin - start) && etof(oldself) < etof(e))
+ else if(vlen2(ent.origin - start) == vlen2(e.origin - start) && etof(ent) < etof(e))
++effectnum;
}
fputs(f, strcat("\"race_place\" \"", ftos(effectnum), "\"\n"));
void Drag_MoveDrag(entity from, entity to);
.entity dragentity;
-float CheatFrame()
-{SELFPARAM();
+float CheatFrame(entity this)
+{
BEGIN_CHEAT_FUNCTION();
// Dragging can be used as either a cheat, or a function for some objects. If sv_cheats is active,
}
}
-void DragBox_Think()
-{SELFPARAM();
+void DragBox_Think(entity this)
+{
if(this.aiment && this.enemy)
{
this.origin_x = (this.aiment.origin.x + this.enemy.origin.x) * 0.5;