From f17cc948a45abffc1e1f9ddaaa6cd9644a1d83a3 Mon Sep 17 00:00:00 2001 From: Wanne Date: Sat, 17 May 2008 21:51:32 +0000 Subject: [PATCH] - fixed map editor incompatibility with the merged multiplayer code - fixed crashes when loading modified maps in tactical - added missing "is_networked" condition to the method AddPossiblePendingEnemiesToBattle() git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2177 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Multiplayer/client.cpp | 6 +++++- Strategic/Queen Command.cpp | 7 +++++-- Tactical/Soldier Create.h | 1 - Tactical/Tactical.vcproj | 4 ++-- Tactical/Tactical_2005Express.vcproj | 1 - 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Multiplayer/client.cpp b/Multiplayer/client.cpp index 9c2e1d57..07b7b40f 100644 --- a/Multiplayer/client.cpp +++ b/Multiplayer/client.cpp @@ -881,7 +881,11 @@ void recieveAI (RPCParameters *rpcParameters) new_standard_data.bMedical = send_inv->standard_data.bMedical; new_standard_data.bMorale = send_inv->standard_data.bMorale; new_standard_data.bOrders = send_inv->standard_data.bOrders; - memcpy( new_standard_data.PADDINGSLOTS, send_inv->standard_data.PADDINGSLOTS, sizeof( INT8 ) * 14 ); + + // WANNE - MP: I had to remove this line of code, because PADDINGSLOTS in the structure + // breaks the editor and leads to crashed of modifed maps! + //memcpy( new_standard_data.PADDINGSLOTS, send_inv->standard_data.PADDINGSLOTS, sizeof( INT8 ) * 14 ); + new_standard_data.bPatrolCnt = send_inv->standard_data.bPatrolCnt; new_standard_data.bSectorZ = send_inv->standard_data.bSectorZ; new_standard_data.bStrength = send_inv->standard_data.bStrength; diff --git a/Strategic/Queen Command.cpp b/Strategic/Queen Command.cpp index 02324e3d..3b49b535 100644 --- a/Strategic/Queen Command.cpp +++ b/Strategic/Queen Command.cpp @@ -1206,9 +1206,12 @@ void AddPossiblePendingEnemiesToBattle() static UINT8 ubPredefinedInsertionCode = 255; // haydent - if ((is_client && !is_server) || ENEMY_ENABLED==0) + if (is_networked) { - return; + if ((is_client && !is_server) || ENEMY_ENABLED==0) + { + return; + } } // check if no world is loaded diff --git a/Tactical/Soldier Create.h b/Tactical/Soldier Create.h index 35565889..ab32a81f 100644 --- a/Tactical/Soldier Create.h +++ b/Tactical/Soldier Create.h @@ -272,7 +272,6 @@ public: BOOLEAN fUseGivenVehicle; INT8 bUseGivenVehicleID; BOOLEAN fHasKeys; - INT8 PADDINGSLOTS[ 14 ]; // // New and OO stuff goes after here. Above this point any changes will goof up reading from files. diff --git a/Tactical/Tactical.vcproj b/Tactical/Tactical.vcproj index e1d763a1..290d45c5 100644 --- a/Tactical/Tactical.vcproj +++ b/Tactical/Tactical.vcproj @@ -333,7 +333,7 @@