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
This commit is contained in:
ChrisL
2008-04-29 17:33:49 +00:00
parent 6d4b38541b
commit 5a57354297
5 changed files with 70 additions and 59 deletions
+6 -2
View File
@@ -156,6 +156,8 @@ void EntryInitEditorItemsInfo()
item = &Item[i]; item = &Item[i];
//if( Item[i].fFlags & ITEM_NOT_EDITOR ) //if( Item[i].fFlags & ITEM_NOT_EDITOR )
// continue; // continue;
if(item->notineditor)
continue;
if( i == SWITCH || i == ACTION_ITEM ) if( i == SWITCH || i == ACTION_ITEM )
{ {
@@ -404,9 +406,10 @@ void InitEditorItemsInfo(UINT32 uiItemType)
break; break;
item = &Item[usCounter]; item = &Item[usCounter];
//if( Item[usCounter].fFlags & ITEM_NOT_EDITOR ) //if( Item[usCounter].fFlags & ITEM_NOT_EDITOR )
if(item->notineditor)
{ {
// usCounter++; usCounter++;
// continue; continue;
} }
if( eInfo.uiItemType == TBAR_MODE_ITEM_TRIGGERS ) if( eInfo.uiItemType == TBAR_MODE_ITEM_TRIGGERS )
{ {
@@ -1664,3 +1667,4 @@ void DisplayItemStatistics()
+4 -4
View File
@@ -13,12 +13,12 @@
#ifdef JA2EDITOR #ifdef JA2EDITOR
//MAP EDITOR BUILD VERSION //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 #elif defined JA2BETAVERSION
//BETA/TEST BUILD VERSION //BETA/TEST BUILD VERSION
CHAR16 zVersionLabel[256] = { L"Debug v1.13.2085" }; CHAR16 zVersionLabel[256] = { L"Debug v1.13.2088" };
#elif defined CRIPPLED_VERSION #elif defined CRIPPLED_VERSION
@@ -28,11 +28,11 @@ CHAR16 zVersionLabel[256] = { L"Beta v. 0.98" };
#else #else
//RELEASE BUILD VERSION //RELEASE BUILD VERSION
CHAR16 zVersionLabel[256] = { L"Release v1.13.2085" }; CHAR16 zVersionLabel[256] = { L"Release v1.13.2088" };
#endif #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" }; CHAR16 zTrackingNumber[16] = { L"Z" };
@@ -31,6 +31,7 @@
#include "Sound Control.h" #include "Sound Control.h"
#include "interface panels.h" #include "interface panels.h"
#include "wordwrap.h" #include "wordwrap.h"
#include "Soldier macros.h"
#endif #endif
#include "ShopKeeper Interface.h" #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 ]); 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 ( !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; if(ItemSlotLimit( &twItem->object, STACK_SIZE_LIMIT ) == 1)
MAPInternalInitItemDescriptionBox( &twItem->object, 0, MercPtrs[gCharactersList[bSelectedInfoChar].usSolID] ); {
} fShowInventoryFlag = TRUE;
else if(gpItemPointer == NULL || gpItemPointer->usItem == twItem->object.usItem || ValidAttachment(gpItemPointer->usItem, twItem->object.usItem) == TRUE || ValidAmmoType(twItem->object.usItem, gpItemPointer->usItem) == TRUE) MAPInternalInitItemDescriptionBox( &twItem->object, 0, MercPtrs[gCharactersList[bSelectedInfoChar].usSolID] );
{ }
InitSectorStackPopup( MercPtrs[gCharactersList[bSelectedInfoChar].usSolID], twItem, iCounter, 0, INV_REGION_Y, 261, ( SCREEN_HEIGHT - PLAYER_INFO_Y ) ); else if(gpItemPointer == NULL || gpItemPointer->usItem == twItem->object.usItem || ValidAttachment(gpItemPointer->usItem, twItem->object.usItem) == TRUE || ValidAmmoType(twItem->object.usItem, gpItemPointer->usItem) == TRUE)
fTeamPanelDirty=TRUE; {
fInterfacePanelDirty = DIRTYLEVEL2; InitSectorStackPopup( MercPtrs[gCharactersList[bSelectedInfoChar].usSolID], twItem, iCounter, 0, INV_REGION_Y, 261, ( SCREEN_HEIGHT - PLAYER_INFO_Y ) );
fTeamPanelDirty=TRUE;
fInterfacePanelDirty = DIRTYLEVEL2;
}
} }
} }
} }
+45 -42
View File
@@ -6234,65 +6234,68 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent )
if(bSelectedInfoChar != -1) if(bSelectedInfoChar != -1)
{ {
SOLDIERTYPE *pSoldier = MercPtrs[ gCharactersList[ bSelectedInfoChar ].usSolID ]; SOLDIERTYPE *pSoldier = MercPtrs[ gCharactersList[ bSelectedInfoChar ].usSolID ];
if(!fShowMapInventoryPool) if(OK_CONTROLLABLE_MERC( pSoldier ))
{ {
fShowMapInventoryPool = TRUE; if(!fShowMapInventoryPool)
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))
{ {
for(unsigned int i = 0; i<pInventoryPoolList.size(); i++) 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(pInventoryPoolList[i].fExists == TRUE && (pInventoryPoolList[i].usFlags & WORLD_ITEM_REACHABLE)) for(unsigned int i = 0; i<pInventoryPoolList.size(); i++)
{ {
for(int x = 0; x<NUM_INV_SLOTS; x++) if(pInventoryPoolList[i].fExists == TRUE && (pInventoryPoolList[i].usFlags & WORLD_ITEM_REACHABLE))
{ {
if(vehicleInv[x] == FALSE) for(int x = 0; x<NUM_INV_SLOTS; x++)
continue;
if(pSoldier->inv[x].exists() == true)
{ {
if(pSoldier->inv[x].usItem != pInventoryPoolList[i].object.usItem) if(vehicleInv[x] == FALSE)
continue; 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 else
pInventoryPoolList[i].object.AddObjectsToStack(pSoldier->inv[x], -1, pSoldier, x); pInventoryPoolList[i].object.MoveThisObjectTo(pSoldier->inv[x], -1, pSoldier, x);
} if(pInventoryPoolList[i].object.ubNumberOfObjects < 0)
else {
pInventoryPoolList[i].object.MoveThisObjectTo(pSoldier->inv[x], -1, pSoldier, x); //RemoveItemFromWorld(i);
if(pInventoryPoolList[i].object.ubNumberOfObjects < 0) break;
{ }
//RemoveItemFromWorld(i);
break;
} }
} }
fTeamPanelDirty = TRUE;
fMapPanelDirty = TRUE;
fInterfacePanelDirty = DIRTYLEVEL2;
} }
fTeamPanelDirty = TRUE;
fMapPanelDirty = TRUE;
fInterfacePanelDirty = DIRTYLEVEL2;
} }
} }
} else
else
{
//CHRISL: drop all items
if ( bSelectedInfoChar != -1 && fShowInventoryFlag && fShowMapInventoryPool && !(gTacticalStatus.fEnemyInSector) )
{ {
for(int i = BODYPOSFINAL; i<NUM_INV_SLOTS; i++) //CHRISL: drop all items
if ( bSelectedInfoChar != -1 && fShowInventoryFlag && fShowMapInventoryPool && !(gTacticalStatus.fEnemyInSector) )
{ {
if(pSoldier->inv[i].exists() == true) for(int i = BODYPOSFINAL; i<NUM_INV_SLOTS; i++)
{ {
AutoPlaceObjectInInventoryStash(&pSoldier->inv[i], pSoldier->sGridNo); if(pSoldier->inv[i].exists() == true)
DeleteObj(&pSoldier->inv[i]); {
AutoPlaceObjectInInventoryStash(&pSoldier->inv[i], pSoldier->sGridNo);
DeleteObj(&pSoldier->inv[i]);
}
fTeamPanelDirty = TRUE;
fMapPanelDirty = TRUE;
fInterfacePanelDirty = DIRTYLEVEL2;
} }
fTeamPanelDirty = TRUE;
fMapPanelDirty = TRUE;
fInterfacePanelDirty = DIRTYLEVEL2;
} }
} }
} }
+2 -2
View File
@@ -66,7 +66,7 @@
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="Winmm.lib" AdditionalDependencies="Winmm.lib"
OutputFile="$(OutDir)\ja2_deb_en_2063.exe" OutputFile="$(OutDir)\ja2_deb_en_2088.exe"
LinkIncremental="2" LinkIncremental="2"
GenerateDebugInformation="true" GenerateDebugInformation="true"
SubSystem="2" SubSystem="2"
@@ -145,7 +145,7 @@
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="Winmm.lib" AdditionalDependencies="Winmm.lib"
OutputFile="$(OutDir)\ja2_rel_en_2063.exe" OutputFile="$(OutDir)\ja2_rel_en_2088.exe"
LinkIncremental="1" LinkIncremental="1"
GenerateDebugInformation="true" GenerateDebugInformation="true"
GenerateMapFile="true" GenerateMapFile="true"