]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Trying ONE more idea with RefSys
authorSamual <samual@xonotic.org>
Wed, 5 Sep 2012 06:49:25 +0000 (02:49 -0400)
committerSamual <samual@xonotic.org>
Wed, 5 Sep 2012 06:49:25 +0000 (02:49 -0400)
qcsrc/server/mutators/gamemode_ctf.qc
qcsrc/warpzonelib/common.qc
qcsrc/warpzonelib/common.qh

index f705621712d01c4cdf93e380e8a366e1b3694f94..135a4c150ca1393c512b083225c220c026ae9b3d 100644 (file)
@@ -273,7 +273,8 @@ void ctf_Handle_Throw(entity player, entity reciever, float droptype)
        {
                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;
                }
@@ -711,7 +712,7 @@ void ctf_FlagThink()
                {
                        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");
index 7bbebdc9c2a707ad0cd5366d2f1de44456db6838..8907a1d32c5a8aa724b71ffbed01f4e521eb3bd4 100644 (file)
@@ -734,3 +734,17 @@ entity WarpZone_RefSys_SpawnSameRefSys(entity me)
        }
        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;
+}
index c2f36bea868d8baf7ad06c37294b3b7bb2316a24..6082b891b7a0edfc9bcd8ddc65f36c8f63317a8b 100644 (file)
@@ -70,6 +70,7 @@ vector WarpZone_RefSys_TransformVelocity(entity from, entity to, vector vel);
 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)))