From 0a7a5059129508dd9ea4ff287a4b53ad91afcecf Mon Sep 17 00:00:00 2001 From: kreatordxx <> Date: Sat, 13 Dec 2008 04:05:30 +0000 Subject: [PATCH] Fix short_frameinfo sending code for big endian processors --- CHANGELOG.txt | 4 ++++ main/network.c | 17 ++--------------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 779292d46..9834c763a 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,9 @@ D1X-Rebirth Changelog +20081213 +-------- +main/network.c: Fix short_frameinfo sending code for big endian processors + 20081212 -------- main/netpkt.c, main/netpkt.h, main/network.c, main/network.h: Cleaned a frameinfo-packet related code and introduced more of D2X - especially for short packets (which is thankfully covered by Version checking) diff --git a/main/network.c b/main/network.c index 04319df5a..451dabc0d 100644 --- a/main/network.c +++ b/main/network.c @@ -3297,37 +3297,24 @@ void network_do_frame(int force, int listen) if (Netgame.flags & NETFLAG_SHORTPACKETS) { -#ifdef WORDS_BIGENDIAN - ubyte send_data[MAX_DATA_SIZE]; - //int squished_size; -#endif int i; memset(&ShortSyncPack,0,sizeof(short_frame_info)); - create_shortpos(&ShortSyncPack.thepos, Objects+objnum, 0); + create_shortpos(&ShortSyncPack.thepos, Objects+objnum, 1); ShortSyncPack.type = PID_PDATA; ShortSyncPack.playernum = Player_num; ShortSyncPack.obj_render_type = Objects[objnum].render_type; ShortSyncPack.level_num = Current_level_num; - ShortSyncPack.data_size = MySyncPack.data_size; + ShortSyncPack.data_size = INTEL_SHORT(MySyncPack.data_size); memcpy (&ShortSyncPack.data[0],&MySyncPack.data[0],MySyncPack.data_size); MySyncPack.numpackets = INTEL_INT(Players[0].n_packets_sent++); ShortSyncPack.numpackets = MySyncPack.numpackets; -#ifndef WORDS_BIGENDIAN // NetDrvSendGamePacket((ubyte*)&ShortSyncPack, sizeof(short_frame_info) - NET_XDATA_SIZE + MySyncPack.data_size); for(i=0; i