From 1ff6f798c30c09821087eefcb381fba6cf37c7f8 Mon Sep 17 00:00:00 2001 From: SpaceViking Date: Fri, 15 Jun 2007 02:57:50 +0000 Subject: [PATCH] Update inventory arrays to be vectors. Add class for inventory. Change some structs that use inventories to classes to provide constructors, destructors, etc. Note that with this update all file operations should still be compatible with previous files. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@970 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Strategic/Auto Resolve.cpp | 3 ++- Strategic/Map Screen Helicopter.cpp | 4 +++- Strategic/Map Screen Interface Map Inventory.cpp | 1 - Strategic/Map Screen Interface.cpp | 8 +++++--- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Strategic/Auto Resolve.cpp b/Strategic/Auto Resolve.cpp index b0bc8de8..e7201163 100644 --- a/Strategic/Auto Resolve.cpp +++ b/Strategic/Auto Resolve.cpp @@ -3431,7 +3431,8 @@ void CreateTempPlayerMerc() UINT8 ubID; //Init the merc create structure with basic information - memset( &MercCreateStruct, 0, sizeof( MercCreateStruct ) ); + // WDS - Clean up inventory handling + //memset( &MercCreateStruct, 0, sizeof( MercCreateStruct ) ); MercCreateStruct.bTeam = SOLDIER_CREATE_AUTO_TEAM; MercCreateStruct.ubProfile = GetUnusedMercProfileID(); MercCreateStruct.sSectorX = gpAR->ubSectorX; diff --git a/Strategic/Map Screen Helicopter.cpp b/Strategic/Map Screen Helicopter.cpp index 4a982be8..51f60254 100644 --- a/Strategic/Map Screen Helicopter.cpp +++ b/Strategic/Map Screen Helicopter.cpp @@ -941,7 +941,9 @@ void SetUpHelicopterForPlayer( INT16 sX, INT16 sY ) Assert( iHelicopterVehicleId != -1 ); - memset( &SoldierSkyRider, 0, sizeof( SOLDIERTYPE ) ); + // WDS - Clean up inventory handling + //memset( &SoldierSkyRider, 0, SIZEOF_SOLDIERTYPE ); + SoldierSkyRider.initialize(); SoldierSkyRider.ubProfile = SKYRIDER; SoldierSkyRider.bLife = 80; diff --git a/Strategic/Map Screen Interface Map Inventory.cpp b/Strategic/Map Screen Interface Map Inventory.cpp index 54119bb6..19200fe7 100644 --- a/Strategic/Map Screen Interface Map Inventory.cpp +++ b/Strategic/Map Screen Interface Map Inventory.cpp @@ -19,7 +19,6 @@ #include "Text.h" #include "Font Control.h" #include "strategicmap.h" - #include "World Items.h" #include "Tactical Save.h" #include "Soldier Control.h" #include "Overhead.h" diff --git a/Strategic/Map Screen Interface.cpp b/Strategic/Map Screen Interface.cpp index 963ddfbb..14183106 100644 --- a/Strategic/Map Screen Interface.cpp +++ b/Strategic/Map Screen Interface.cpp @@ -1804,9 +1804,11 @@ INT32 SetUpDropItemListForMerc( UINT32 uiMercId ) DropKeysInKeyRing( MercPtrs[ uiMercId ], NOWHERE, 0, 0, TRUE, iSlotIndex, FALSE ); // zero out profiles - memset( ( gMercProfiles[ Menptr[ uiMercId ].ubProfile ].bInvStatus ), 0, sizeof( UINT8 ) * 19 ); - memset( ( gMercProfiles[ Menptr[ uiMercId ].ubProfile ].bInvNumber ), 0, sizeof( UINT8 ) * 19 ); - memset( ( gMercProfiles[ Menptr[ uiMercId ].ubProfile ].inv ), 0, sizeof( UINT16 ) * 19 ); + // WDS - Clean up inventory handling + //memset( ( gMercProfiles[ Menptr[ uiMercId ].ubProfile ].bInvStatus ), 0, sizeof( UINT8 ) * 19 ); + //memset( ( gMercProfiles[ Menptr[ uiMercId ].ubProfile ].bInvNumber ), 0, sizeof( UINT8 ) * 19 ); + //memset( ( gMercProfiles[ Menptr[ uiMercId ].ubProfile ].inv ), 0, sizeof( UINT16 ) * 19 ); + gMercProfiles[ Menptr[ uiMercId ].ubProfile ].clearInventory(); return( iSlotIndex ); }