- fix: lines in UDB were displayed incorrectly

- fix: food does not decay the first time a sector is entered (to prevent pre-placed items from rotting)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5448 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2012-08-07 20:38:29 +00:00
parent 771d7179bf
commit 9a045be6ce
2 changed files with 9 additions and 3 deletions
@@ -5090,7 +5090,13 @@ void HandleSectorCooldownFunctions( INT16 sMapX, INT16 sMapY, INT8 sMapZ, WORLDI
if ( fWithMinutes )
{
INT32 sMinutesPassed = __max(0, GetWorldTotalMin() - GetLastTimePlayerWasInSector(sMapX, sMapY, sMapZ) );
UINT32 usLastVisited = GetLastTimePlayerWasInSector(sMapX, sMapY, sMapZ);
// if usLastVisited is 0, we have not yet visited this sector. We don't want to cooldown anything in this case (preplaced food could become rotten jsut because we visit this sector late in our campaign)
if ( usLastVisited == 0 )
return;
UINT32 sMinutesPassed = __max(0, GetWorldTotalMin() - usLastVisited );
if ( sMinutesPassed == 0 )
return;