Improve loading speed of stash (by Moa)

- improved processing of sector stash (opening/closing)
- improved loading speed of save games
- improved processing of items droped by militia (most noteable after autoresolve)
- and some other code related changes
see: http://www.ja-galaxy-forum.com/board/ubbthreads.php/topics/325332/FIX_improve_loading_speed_of_s.html#Post325332

Notes:
removed some functions, still in code so but renamed to *_OLD() because they are from Sirtech and should be kept as I have read in "§18) If possible, we don't just delete the old code, but comment it out (or #ifdef it out) for reference. We delete it only if it's really necessary."

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6434 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2013-09-23 06:59:29 +00:00
parent 78b4e784b6
commit 5df38d5042
10 changed files with 494 additions and 28 deletions
+15 -1
View File
@@ -2885,6 +2885,10 @@ SOLDIERTYPE *pSoldier=NULL;
#endif
}
extern void SetLastTimePlayerWasInSector();
//Moa: 09/14/2013 this function modifies uiTimeCurrentSectorWasLastLoaded and the various decay of items in that sector as well
// @calls HandleSectorCooldownFunctions
// @calls SetLastTimePlayerWasInSector
BOOLEAN EnterSector( INT16 sSectorX, INT16 sSectorY , INT8 bSectorZ )
{
INT32 i;
@@ -3017,7 +3021,17 @@ BOOLEAN EnterSector( INT16 sSectorX, INT16 sSectorY , INT8 bSectorZ )
// Flugente: certain features need to alter an item's temperature value depending on the time passed
// if we do these functions here and adjust for the time passed since this sector was loaded last, it will seem to the player
// as if these checks are always performed in any sector
SectorInventoryCooldownFunctions(sSectorX, sSectorY, bSectorZ);
//Moa: removed this function and replaced by the handling function.
//SectorInventoryCooldownFunctions(sSectorX, sSectorY, bSectorZ);
//moved from SectorInventoryCooldownFunctions. Invisible items are handled as well.
//Since we have allready loaded the items previously we can use the globals here.
HandleSectorCooldownFunctions( sSectorX, sSectorY, (INT8)bSectorZ, gWorldItems, guiNumWorldItems, TRUE );
//Update LastTimePlayerWasInSector
SetLastTimePlayerWasInSector();
//Save to tempfile
SaveWorldItemsToTempItemFile( sSectorX, sSectorY, (INT8)bSectorZ, guiNumWorldItems, gWorldItems );
return TRUE; //because the map was loaded.
}