mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Brief: //dnl ch75
- More map editor fixes and map inventory pool performance improvement for big maps. Details: - Fix not showing expected messagebox on exit (ALT+x) which also throw exception and goes to improper mapeditor exit. - Fix second annoying sticky message which shouldn't popup during map loading and performing RemoveProhibitedAttachments. - Fix CTD when delete all enemies or civilians or all of them in map. - Fix some std exception when reporting for missing optional xml file. - Fix memory and map corruption in old mapeditors if loaded old map has item with invalid attachment and we try to attach something else. - As years ago pInventoryPoolList had migrated from WORLDITEM* array to std::vector<WORLDITEM> it was time to do that with gWorldItems too, all necessary functions which need to be adopted to gWorldItems std::vector type are also changed. - Resize code for gWorldItems is changed hoping will lead into less corruption problems as now could occur in mapeditor and game when code automatically doing attachment changes. - Change code for handling map inventory which now should be fast enough to support AIMNAS project which will probably deal with thousands of items per map. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6554 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -423,12 +423,9 @@ void HandleDelayedItemsArrival( UINT32 uiReason )
|
||||
INT32 sStartGridNo;
|
||||
UINT32 uiNumWorldItems, uiLoop;
|
||||
BOOLEAN fOk;
|
||||
WORLDITEM * pTemp = 0;
|
||||
std::vector<WORLDITEM> pTemp;//dnl ch75 271013
|
||||
UINT8 ubLoop;
|
||||
|
||||
|
||||
|
||||
//#if 0
|
||||
if (uiReason == NPC_SYSTEM_EVENT_ACTION_PARAM_BONUS + NPC_ACTION_RETURN_STOLEN_SHIPMENT_ITEMS )
|
||||
{
|
||||
if ( gMercProfiles[ PABLO ].bMercStatus == MERC_IS_DEAD )
|
||||
@@ -504,11 +501,7 @@ void HandleDelayedItemsArrival( UINT32 uiReason )
|
||||
{
|
||||
return;
|
||||
}
|
||||
pTemp = new WORLDITEM[ uiNumWorldItems];
|
||||
if (!pTemp)
|
||||
{
|
||||
return;
|
||||
}
|
||||
pTemp.resize(uiNumWorldItems);//dnl ch75 271013
|
||||
fOk = LoadWorldItemsFromTempItemFile( BOBBYR_SHIPPING_DEST_SECTOR_X, BOBBYR_SHIPPING_DEST_SECTOR_Y, BOBBYR_SHIPPING_DEST_SECTOR_Z, pTemp );
|
||||
if (fOk)
|
||||
{
|
||||
@@ -522,13 +515,6 @@ void HandleDelayedItemsArrival( UINT32 uiReason )
|
||||
AddWorldItemsToUnLoadedSector( BOBBYR_SHIPPING_DEST_SECTOR_X, BOBBYR_SHIPPING_DEST_SECTOR_Y, BOBBYR_SHIPPING_DEST_SECTOR_Z, 0, uiNumWorldItems, pTemp, TRUE );
|
||||
}
|
||||
}
|
||||
|
||||
if (pTemp) {
|
||||
delete [] pTemp;
|
||||
}
|
||||
|
||||
//#endif
|
||||
|
||||
}
|
||||
|
||||
void AddSecondAirportAttendant( void )
|
||||
|
||||
Reference in New Issue
Block a user