mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +02:00
- fixed an instance of wrong assignment strings
- prisoner decision messagebox now allows to select a specific prison - Fix: under certain conditions, calling militia reinforcements with militia equipment selection could get sector items with invalid GridNo to become lost git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5888 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -3726,17 +3726,17 @@ void SearchItemRetrieval( WORLDITEM* pWorldItem, ItemSearchStruct* pSi, SOLDIERC
|
||||
if ( pSi->found && !pSi->done )
|
||||
{
|
||||
UINT8 usRealTake = min(usTake, pWorldItem[ pSi->pos ].object.ubNumberOfObjects);
|
||||
pWorldItem[ pSi->pos ].object.MoveThisObjectTo(gTempObject, usRealTake );
|
||||
pWorldItem[ pSi->pos ].object.MoveThisObjectTo(pp->Inv[ pSi->soldierslot ], usRealTake );
|
||||
|
||||
for ( UINT8 i = 0; i < usRealTake; ++i )
|
||||
gTempObject[i]->data.sObjectFlag |= TAKEN_BY_MILITIA;
|
||||
|
||||
pp->Inv[ pSi->soldierslot ] = gTempObject;
|
||||
(pp->Inv[ pSi->soldierslot ])[i]->data.sObjectFlag |= TAKEN_BY_MILITIA;
|
||||
|
||||
if ( pWorldItem[ pSi->pos ].object.ubNumberOfObjects < 1 )
|
||||
{
|
||||
RemoveItemFromPool(pWorldItem[ pSi->pos ].sGridNo, (pSi->pos), pWorldItem[ pSi->pos ].ubLevel);
|
||||
pWorldItem[ pSi->pos ].fExists = FALSE;
|
||||
|
||||
// setting this to false can lead to cases where we 'forget' items without a valid gridno - though I am unsure why.
|
||||
//pWorldItem[ pSi->pos ].fExists = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4684,6 +4684,14 @@ void TakeMilitiaEquipmentfromSector( INT16 sMapX, INT16 sMapY, INT8 sMapZ, SOLDI
|
||||
|
||||
// Exit: Save changed inventory
|
||||
|
||||
#ifdef JA2TESTVERSION
|
||||
std::vector<std::pair<BOOLEAN, UINT16> > overviewvector2;
|
||||
for( uiCount = 0; uiCount < uiTotalNumberOfRealItems; ++uiCount )
|
||||
{
|
||||
overviewvector2.push_back( std::pair<BOOLEAN, UINT16>(pWorldItem[ uiCount ].fExists, pWorldItem[ uiCount ].object.usItem) );
|
||||
}
|
||||
#endif
|
||||
|
||||
// save the changed inventory
|
||||
// open sector inv
|
||||
if( ( sMapX == gWorldSectorX )&&( gWorldSectorY == sMapY ) && (gbWorldSectorZ == sMapZ ) )
|
||||
|
||||
Reference in New Issue
Block a user