]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use a temporary hack to fix teleporters and jumppads not finding their targets
authorMario <mario@smbclan.net>
Mon, 30 Nov 2015 03:44:45 +0000 (13:44 +1000)
committerMario <mario@smbclan.net>
Mon, 30 Nov 2015 03:44:45 +0000 (13:44 +1000)
qcsrc/common/triggers/misc/teleport_dest.qc
qcsrc/common/triggers/trigger/jumppads.qc
qcsrc/common/triggers/trigger/teleport.qc

index a53b5c056c89c848ace83738b71a70e0dfcd7e61..5a367308e4d0ebd0bd2c51b448b71b189a2e6db1 100644 (file)
@@ -2,20 +2,24 @@ REGISTER_NET_LINKED(ENT_CLIENT_TELEPORT_DEST)
 
 #ifdef SVQC
 
-bool teleport_dest_send(entity this, entity to, float sf)
+bool teleport_dest_send(entity this, entity to, int sf)
 {
        WriteHeader(MSG_ENTITY, ENT_CLIENT_TELEPORT_DEST);
+       WriteByte(MSG_ENTITY, sf);
 
-       WriteByte(MSG_ENTITY, self.cnt);
-       WriteCoord(MSG_ENTITY, self.speed);
-       WriteString(MSG_ENTITY, self.targetname);
-       WriteCoord(MSG_ENTITY, self.origin_x);
-       WriteCoord(MSG_ENTITY, self.origin_y);
-       WriteCoord(MSG_ENTITY, self.origin_z);
-
-       WriteAngle(MSG_ENTITY, self.mangle_x);
-       WriteAngle(MSG_ENTITY, self.mangle_y);
-       WriteAngle(MSG_ENTITY, self.mangle_z);
+       if(sf & 1)
+       {
+               WriteByte(MSG_ENTITY, this.cnt);
+               WriteCoord(MSG_ENTITY, this.speed);
+               WriteString(MSG_ENTITY, this.targetname);
+               WriteCoord(MSG_ENTITY, this.origin_x);
+               WriteCoord(MSG_ENTITY, this.origin_y);
+               WriteCoord(MSG_ENTITY, this.origin_z);
+
+               WriteAngle(MSG_ENTITY, this.mangle_x);
+               WriteAngle(MSG_ENTITY, this.mangle_y);
+               WriteAngle(MSG_ENTITY, this.mangle_z);
+       }
 
        return true;
 }
@@ -70,24 +74,29 @@ void teleport_dest_remove()
 
 NET_HANDLE(ENT_CLIENT_TELEPORT_DEST, bool isnew)
 {
-       self.classname = "info_teleport_destination";
-       self.cnt = ReadByte();
-       self.speed = ReadCoord();
-       self.targetname = strzone(ReadString());
-       self.origin_x = ReadCoord();
-       self.origin_y = ReadCoord();
-       self.origin_z = ReadCoord();
+       int sf = ReadByte();
 
-       self.mangle_x = ReadAngle();
-       self.mangle_y = ReadAngle();
-       self.mangle_z = ReadAngle();
+       if(sf & 1)
+       {
+               self.classname = "info_teleport_destination";
+               self.cnt = ReadByte();
+               self.speed = ReadCoord();
+               self.targetname = strzone(ReadString());
+               self.origin_x = ReadCoord();
+               self.origin_y = ReadCoord();
+               self.origin_z = ReadCoord();
+
+               self.mangle_x = ReadAngle();
+               self.mangle_y = ReadAngle();
+               self.mangle_z = ReadAngle();
+
+               setorigin(self, self.origin);
+
+               self.drawmask = MASK_NORMAL;
+               self.entremove = teleport_dest_remove;
+       }
 
        return = true;
-
-       setorigin(self, self.origin);
-
-       self.drawmask = MASK_NORMAL;
-       self.entremove = teleport_dest_remove;
 }
 
 #endif
index 6a4332681bb89032a5297aa972c7eaa9f982f28b..07c9d6da9ba71c4ec2154d0ca04e5e824703e8c5 100644 (file)
@@ -438,7 +438,7 @@ NET_HANDLE(ENT_CLIENT_TRIGGER_PUSH, bool isnew)
                self.move_touch = trigger_push_touch;
                self.drawmask = MASK_NORMAL;
                self.move_time = time;
-               trigger_push_findtarget();
+               defer(self, 0.25, trigger_push_findtarget);
        }
 
        if(sf & 2)
index 88bf33b8addb581e0a69e5377760bf276cf150af..9fb6f48b61c9ea1586ad2b083384a61d6b4cd22b 100644 (file)
@@ -63,18 +63,18 @@ float trigger_teleport_send(entity this, entity to, float sf)
 
        if(sf & 1)
        {
-               WriteByte(MSG_ENTITY, self.team);
-               WriteInt24_t(MSG_ENTITY, self.spawnflags);
-               WriteByte(MSG_ENTITY, self.active);
-               WriteCoord(MSG_ENTITY, self.speed);
+               WriteByte(MSG_ENTITY, this.team);
+               WriteInt24_t(MSG_ENTITY, this.spawnflags);
+               WriteByte(MSG_ENTITY, this.active);
+               WriteCoord(MSG_ENTITY, this.speed);
 
                trigger_common_write(true);
        }
 
        if(sf & 2)
        {
-               WriteByte(MSG_ENTITY, self.team);
-               WriteByte(MSG_ENTITY, self.active);
+               WriteByte(MSG_ENTITY, this.team);
+               WriteByte(MSG_ENTITY, this.active);
        }
 
        return true;
@@ -128,7 +128,7 @@ NET_HANDLE(ENT_CLIENT_TRIGGER_TELEPORT, bool isnew)
                //self.move_touch = trigger_push_touch;
                self.drawmask = MASK_NORMAL;
                self.move_time = time;
-               teleport_findtarget();
+               defer(self, 0.25, teleport_findtarget);
 
                self.teleport_next = teleport_first;
                teleport_first = self;