- improved cooldown/decay functions. every time a sector inventory gets loaded, its inventory gets cooled down, thus all accessible world items always have the correct values.

- OVERHEATING_SET_ZERO_UPON_NEW_SECTOR is not used anymore

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5443 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2012-08-04 17:51:12 +00:00
parent cd6a07d4be
commit 771d7179bf
15 changed files with 228 additions and 320 deletions
+34
View File
@@ -129,6 +129,7 @@ BOOLEAN InitTempNpcQuoteInfoForNPCFromTempFile();
BOOLEAN SaveTempNpcQuoteInfoForNPCToTempFile( UINT8 ubNpcId );
BOOLEAN LoadTempNpcQuoteInfoForNPCFromTempFile( UINT8 ubNpcId );
UINT32 GetLastTimePlayerWasInSector();
UINT32 GetLastTimePlayerWasInSector(INT16 sMapX, INT16 sMapY, INT8 sMapZ); // Flugente: get time for another sector
void SetLastTimePlayerWasInSector();
@@ -1411,6 +1412,39 @@ UINT32 GetLastTimePlayerWasInSector()
return( 0 );
}
// Flugente: get time for another sector
UINT32 GetLastTimePlayerWasInSector(INT16 sMapX, INT16 sMapY, INT8 sMapZ)
{
if( !sMapZ )
return( SectorInfo[ SECTOR( sMapX,sMapY) ].uiTimeCurrentSectorWasLastLoaded );
else if( sMapZ > 0 )
{
UNDERGROUND_SECTORINFO *pTempNode = gpUndergroundSectorInfoHead;
pTempNode = gpUndergroundSectorInfoHead;
//loop through and look for the right underground sector
while( pTempNode )
{
if( ( pTempNode->ubSectorX == sMapX ) &&
( pTempNode->ubSectorY == sMapY ) &&
( pTempNode->ubSectorZ == sMapZ ) )
{
//set the flag indicating that ther is a temp item file exists for the sector
return( pTempNode->uiTimeCurrentSectorWasLastLoaded );
}
pTempNode = pTempNode->next;
}
#ifdef JA2TESTVERSION
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_TESTVERSION, L"Failed to Get the 'uiTimeCurrentSectorWasLastLoaded' from an underground sector" );
#endif
return( 0 );
}
return( 0 );
}