From 5a57354297abbeb7f52e39b75ab3483784ddc401 Mon Sep 17 00:00:00 2001 From: ChrisL Date: Tue, 29 Apr 2008 17:33:49 +0000 Subject: [PATCH] Fixed item "beaming" bugs that allowed items to be grabbed from a sector your merc wasn't currently in. Fixed the map editor so that "Nada" items don't appear in the item lists. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2088 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Editor/EditorItems.cpp | 8 +- GameVersion.cpp | 8 +- .../Map Screen Interface Map Inventory.cpp | 22 +++-- Strategic/mapscreen.cpp | 87 ++++++++++--------- ja2_2005Express.vcproj | 4 +- 5 files changed, 70 insertions(+), 59 deletions(-) diff --git a/Editor/EditorItems.cpp b/Editor/EditorItems.cpp index 775310ab..7a6a2ecb 100644 --- a/Editor/EditorItems.cpp +++ b/Editor/EditorItems.cpp @@ -156,6 +156,8 @@ void EntryInitEditorItemsInfo() item = &Item[i]; //if( Item[i].fFlags & ITEM_NOT_EDITOR ) // continue; + if(item->notineditor) + continue; if( i == SWITCH || i == ACTION_ITEM ) { @@ -404,9 +406,10 @@ void InitEditorItemsInfo(UINT32 uiItemType) break; item = &Item[usCounter]; //if( Item[usCounter].fFlags & ITEM_NOT_EDITOR ) + if(item->notineditor) { - // usCounter++; - // continue; + usCounter++; + continue; } if( eInfo.uiItemType == TBAR_MODE_ITEM_TRIGGERS ) { @@ -1664,3 +1667,4 @@ void DisplayItemStatistics() + diff --git a/GameVersion.cpp b/GameVersion.cpp index f37fea07..a9d4dbd5 100644 --- a/GameVersion.cpp +++ b/GameVersion.cpp @@ -13,12 +13,12 @@ #ifdef JA2EDITOR //MAP EDITOR BUILD VERSION -CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.2085" }; +CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.2088" }; #elif defined JA2BETAVERSION //BETA/TEST BUILD VERSION -CHAR16 zVersionLabel[256] = { L"Debug v1.13.2085" }; +CHAR16 zVersionLabel[256] = { L"Debug v1.13.2088" }; #elif defined CRIPPLED_VERSION @@ -28,11 +28,11 @@ CHAR16 zVersionLabel[256] = { L"Beta v. 0.98" }; #else //RELEASE BUILD VERSION - CHAR16 zVersionLabel[256] = { L"Release v1.13.2085" }; + CHAR16 zVersionLabel[256] = { L"Release v1.13.2088" }; #endif -CHAR8 czVersionNumber[16] = { "Build 08.04.27" }; //YY.MM.DD +CHAR8 czVersionNumber[16] = { "Build 08.04.29" }; //YY.MM.DD CHAR16 zTrackingNumber[16] = { L"Z" }; diff --git a/Strategic/Map Screen Interface Map Inventory.cpp b/Strategic/Map Screen Interface Map Inventory.cpp index 5b639943..a464125c 100644 --- a/Strategic/Map Screen Interface Map Inventory.cpp +++ b/Strategic/Map Screen Interface Map Inventory.cpp @@ -31,6 +31,7 @@ #include "Sound Control.h" #include "interface panels.h" #include "wordwrap.h" + #include "Soldier macros.h" #endif #include "ShopKeeper Interface.h" @@ -837,16 +838,19 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason ) WORLDITEM * twItem = &(pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ]); if ( !InSectorStackPopup( ) && !InItemStackPopup( ) && !InItemDescriptionBox( ) && !InKeyRingPopup( ) && twItem->object.exists() == true && (bSelectedInfoChar != -1 && gCharactersList[bSelectedInfoChar].fValid)) { - if(ItemSlotLimit( &twItem->object, STACK_SIZE_LIMIT ) == 1) + if(OK_CONTROLLABLE_MERC( MercPtrs[gCharactersList[bSelectedInfoChar].usSolID] )) { - fShowInventoryFlag = TRUE; - MAPInternalInitItemDescriptionBox( &twItem->object, 0, MercPtrs[gCharactersList[bSelectedInfoChar].usSolID] ); - } - else if(gpItemPointer == NULL || gpItemPointer->usItem == twItem->object.usItem || ValidAttachment(gpItemPointer->usItem, twItem->object.usItem) == TRUE || ValidAmmoType(twItem->object.usItem, gpItemPointer->usItem) == TRUE) - { - InitSectorStackPopup( MercPtrs[gCharactersList[bSelectedInfoChar].usSolID], twItem, iCounter, 0, INV_REGION_Y, 261, ( SCREEN_HEIGHT - PLAYER_INFO_Y ) ); - fTeamPanelDirty=TRUE; - fInterfacePanelDirty = DIRTYLEVEL2; + if(ItemSlotLimit( &twItem->object, STACK_SIZE_LIMIT ) == 1) + { + fShowInventoryFlag = TRUE; + MAPInternalInitItemDescriptionBox( &twItem->object, 0, MercPtrs[gCharactersList[bSelectedInfoChar].usSolID] ); + } + else if(gpItemPointer == NULL || gpItemPointer->usItem == twItem->object.usItem || ValidAttachment(gpItemPointer->usItem, twItem->object.usItem) == TRUE || ValidAmmoType(twItem->object.usItem, gpItemPointer->usItem) == TRUE) + { + InitSectorStackPopup( MercPtrs[gCharactersList[bSelectedInfoChar].usSolID], twItem, iCounter, 0, INV_REGION_Y, 261, ( SCREEN_HEIGHT - PLAYER_INFO_Y ) ); + fTeamPanelDirty=TRUE; + fInterfacePanelDirty = DIRTYLEVEL2; + } } } } diff --git a/Strategic/mapscreen.cpp b/Strategic/mapscreen.cpp index 21224918..474cce8d 100644 --- a/Strategic/mapscreen.cpp +++ b/Strategic/mapscreen.cpp @@ -6234,65 +6234,68 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent ) if(bSelectedInfoChar != -1) { SOLDIERTYPE *pSoldier = MercPtrs[ gCharactersList[ bSelectedInfoChar ].usSolID ]; - if(!fShowMapInventoryPool) + if(OK_CONTROLLABLE_MERC( pSoldier )) { - fShowMapInventoryPool = TRUE; - CreateDestroyMapInventoryPoolButtons( TRUE ); - } - if(!fShowInventoryFlag) - { - fShowInventoryFlag = TRUE; - } - if( fCtrl ) - { - //CHRISL: pickup all items to vehicle - if ( UsingNewInventorySystem() == true && fShowInventoryFlag && fShowMapInventoryPool && !(gTacticalStatus.fEnemyInSector) && gGameExternalOptions.fVehicleInventory && (pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE)) + if(!fShowMapInventoryPool) { - for(unsigned int i = 0; iflags.uiStatusFlags & SOLDIER_VEHICLE)) { - if(pInventoryPoolList[i].fExists == TRUE && (pInventoryPoolList[i].usFlags & WORLD_ITEM_REACHABLE)) + for(unsigned int i = 0; iinv[x].exists() == true) + for(int x = 0; xinv[x].usItem != pInventoryPoolList[i].object.usItem) + if(vehicleInv[x] == FALSE) continue; + if(pSoldier->inv[x].exists() == true) + { + if(pSoldier->inv[x].usItem != pInventoryPoolList[i].object.usItem) + continue; + else + pInventoryPoolList[i].object.AddObjectsToStack(pSoldier->inv[x], -1, pSoldier, x); + } else - pInventoryPoolList[i].object.AddObjectsToStack(pSoldier->inv[x], -1, pSoldier, x); - } - else - pInventoryPoolList[i].object.MoveThisObjectTo(pSoldier->inv[x], -1, pSoldier, x); - if(pInventoryPoolList[i].object.ubNumberOfObjects < 0) - { - //RemoveItemFromWorld(i); - break; + pInventoryPoolList[i].object.MoveThisObjectTo(pSoldier->inv[x], -1, pSoldier, x); + if(pInventoryPoolList[i].object.ubNumberOfObjects < 0) + { + //RemoveItemFromWorld(i); + break; + } } } + fTeamPanelDirty = TRUE; + fMapPanelDirty = TRUE; + fInterfacePanelDirty = DIRTYLEVEL2; } - fTeamPanelDirty = TRUE; - fMapPanelDirty = TRUE; - fInterfacePanelDirty = DIRTYLEVEL2; } } - } - else - { - //CHRISL: drop all items - if ( bSelectedInfoChar != -1 && fShowInventoryFlag && fShowMapInventoryPool && !(gTacticalStatus.fEnemyInSector) ) + else { - for(int i = BODYPOSFINAL; iinv[i].exists() == true) + for(int i = BODYPOSFINAL; iinv[i], pSoldier->sGridNo); - DeleteObj(&pSoldier->inv[i]); + if(pSoldier->inv[i].exists() == true) + { + AutoPlaceObjectInInventoryStash(&pSoldier->inv[i], pSoldier->sGridNo); + DeleteObj(&pSoldier->inv[i]); + } + fTeamPanelDirty = TRUE; + fMapPanelDirty = TRUE; + fInterfacePanelDirty = DIRTYLEVEL2; } - fTeamPanelDirty = TRUE; - fMapPanelDirty = TRUE; - fInterfacePanelDirty = DIRTYLEVEL2; } } } diff --git a/ja2_2005Express.vcproj b/ja2_2005Express.vcproj index da918c93..fafea66c 100644 --- a/ja2_2005Express.vcproj +++ b/ja2_2005Express.vcproj @@ -66,7 +66,7 @@