{
case DROP_PASS:
{
- targ_origin = WarpZone_UnTransformOrigin(reciever, (0.5 * (reciever.absmin + reciever.absmax)));
+ WarpZone_RefSys_MakeSameRefSys(flag, player);
+ targ_origin = WarpZone_RefSys_TransformOrigin(flag, reciever, (0.5 * (reciever.absmin + reciever.absmax)));
flag.velocity = (normalize(targ_origin - player.origin) * autocvar_g_ctf_pass_velocity);
break;
}
{
vector targ_origin = ((self.pass_target.absmin + self.pass_target.absmax) * 0.5);
vector old_targ_origin = targ_origin;
- targ_origin = WarpZone_UnTransformOrigin(self.pass_target, targ_origin);
+ targ_origin = WarpZone_RefSys_TransformOrigin(self, self.pass_target, targ_origin);
WarpZone_TraceLine(self.origin, targ_origin, MOVE_NOMONSTERS, self);
print(strcat("self: ", vtos(self.origin), ", old: ", vtos(old_targ_origin), " (", ftos(vlen(self.origin - old_targ_origin)), "qu)"), ", transformed: ", vtos(targ_origin), " (", ftos(vlen(self.origin - targ_origin)), "qu)", ".\n");
}
return e;
}
+void WarpZone_RefSys_MakeSameRefSys(entity to, entity from)
+{
+ if(from.WarpZone_refsys)
+ {
+ to.WarpZone_refsys = spawn();
+ to.WarpZone_refsys.classname = "warpzone_refsys";
+ to.WarpZone_refsys.owner = to;
+ to.WarpZone_refsys.think = WarpZone_RefSys_GC;
+ to.WarpZone_refsys.nextthink = time + 1;
+ to.WarpZone_refsys.warpzone_shift = from.WarpZone_refsys.warpzone_shift;
+ to.WarpZone_refsys.warpzone_transform = from.WarpZone_refsys.warpzone_transform;
+ }
+ return;
+}
vector WarpZone_RefSys_TransformAngles(entity from, entity to, vector ang);
vector WarpZone_RefSys_TransformVAngles(entity from, entity to, vector ang);
entity WarpZone_RefSys_SpawnSameRefSys(entity me);
+void WarpZone_RefSys_MakeSameRefSys(entity to, entity from);
#ifndef BITCLR
# define BITCLR(a,b) ((a) - ((a) & (b)))