return vs + '0 0 1' * vz;
}
-void check_pushed(entity this)
+void check_pushed(entity this) // first jump pad to think thinks for every jump pad
{
- IL_EACH(this.pushed, WarpZoneLib_ExactTrigger_Touch(this, it),
+ IL_EACH(are_pushed, true,
{
- IL_REMOVE(this.pushed, it);
+ bool empty = true;
+ for(int i = 0; i < MAX_PUSHED; ++i)
+ {
+ if(!it.has_pushed[i]) continue;
+ if(WarpZoneLib_ExactTrigger_Touch(it.has_pushed[i], it))
+ {
+ it.has_pushed[i] = NULL;
+ continue;
+ }
+ empty = false;
+ }
+ if(empty)
+ {
+ IL_REMOVE(are_pushed, it);
+ }
});
- if(!IL_EMPTY(this.pushed))
+
+ if(!IL_EMPTY(are_pushed))
{
this.nextthink = time;
}
org.z += 1; // off by 1!
}
- bool is_pushed = is_velocity_pad && IL_CONTAINS(this.pushed, targ);
+ bool is_pushed = false;
+ if(is_velocity_pad)
+ {
+ for(int i = 0; i < MAX_PUSHED; ++i)
+ {
+ if(this == targ.has_pushed[i])
+ {
+ is_pushed = true;
+ break;
+ }
+ }
+
+ if(!is_pushed && ((this.spawnflags & ADD_XY) || (this.spawnflags & ADD_Z))) // remember jump pads which boost on initial touch
+ {
+ bool limit_reached = true;
+ for(int i = 0; i < MAX_PUSHED; ++i)
+ {
+ if(targ.has_pushed[i]) continue;
+ limit_reached = false;
+ targ.has_pushed[i] = this; // may be briefly out of sync between client and server if client prediction is toggled
+ }
+ if(limit_reached)
+ {
+ return false; // too many overlapping jump pads
+ }
+ IL_PUSH(are_pushed, targ);
+ this.nextthink = time;
+ }
+ }
if(this.enemy)
{
}
}
- if(is_velocity_pad && !is_pushed)
- {
- IL_PUSH(this.pushed, targ); // may be briefly out of sync between client and server if client prediction is toggled
- this.nextthink = time;
- }
-
if(!is_pushed) UNSET_ONGROUND(targ);
#ifdef CSQC
trigger_push_velocity_link(this); // link it now
- this.pushed = IL_NEW();
setthink(this, check_pushed);
}
this.solid = SOLID_TRIGGER;
settouch(this, trigger_push_velocity_touch);
this.move_time = time;
- this.pushed = IL_NEW();
setthink(this, check_pushed);
return true;