From 9a045be6ce9eeec2b50db6b3d04a82b4c3fc8881 Mon Sep 17 00:00:00 2001 From: Flugente Date: Tue, 7 Aug 2012 20:38:29 +0000 Subject: [PATCH] - 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 --- Strategic/Map Screen Interface Map Inventory.cpp | 8 +++++++- Tactical/Interface Enhanced.cpp | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Strategic/Map Screen Interface Map Inventory.cpp b/Strategic/Map Screen Interface Map Inventory.cpp index 585156a0f..bbbf4e143 100644 --- a/Strategic/Map Screen Interface Map Inventory.cpp +++ b/Strategic/Map Screen Interface Map Inventory.cpp @@ -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; diff --git a/Tactical/Interface Enhanced.cpp b/Tactical/Interface Enhanced.cpp index 0f85488a7..c529c1385 100644 --- a/Tactical/Interface Enhanced.cpp +++ b/Tactical/Interface Enhanced.cpp @@ -2709,7 +2709,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr ///////////////////// AIM BONUS MODIFIER if(UsingNewCTHSystem() == false) { - if ( GetAimBonus( NULL, gpItemDescObject, 100, 1 ) != 0 ) + if ( GetAimBonus( gpItemDescSoldier, gpItemDescObject, 100, 1 ) != 0 ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -8807,7 +8807,7 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) ///////////////////// AIM BONUS MODIFIER if(UsingNewCTHSystem() == false) { - iModifier[0] = GetAimBonus( NULL, gpItemDescObject, 100, 1 ); + iModifier[0] = GetAimBonus( gpItemDescSoldier, gpItemDescObject, 100, 1 ); iModifier[1] = 0; iModifier[2] = 0; if (iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0)