From ec07946730e55ced6a449e9be9881b5f7798d9f9 Mon Sep 17 00:00:00 2001 From: Flugente Date: Tue, 20 Aug 2013 20:15:16 +0000 Subject: [PATCH] Changed MOVEITEM dropoff gridno to a location that is always guaranteed to exist and be accessible git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6297 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Strategic/Assignments.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Strategic/Assignments.cpp b/Strategic/Assignments.cpp index 9577ac800..4a4e68f1a 100644 --- a/Strategic/Assignments.cpp +++ b/Strategic/Assignments.cpp @@ -5885,8 +5885,12 @@ void HandleEquipmentMove( INT16 sMapX, INT16 sMapY, INT8 bZ ) // we loop over all mercs with this assignment in this sector, and then do a separate loop over each target sector std::map sectormercmap; // this map uses the sectors we take stuff from as keys and the number of mercs as elements - - // count any interrogators found here, and sum up their interrogation values + + // we need a gridno to which we drop stuff + INT32 sDropOffGridNo = gMapInformation.sCenterGridNo; + if ( !GridNoOnVisibleWorldTile( sDropOffGridNo ) ) + sDropOffGridNo = RandomGridNo(); + SOLDIERTYPE *pSoldier = NULL; UINT32 uiCnt = 0; UINT32 firstid = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; @@ -5904,6 +5908,9 @@ void HandleEquipmentMove( INT16 sMapX, INT16 sMapY, INT8 bZ ) sectormercmap[targetsector]++; else sectormercmap[targetsector] = 1; + + if ( pSoldier->sGridNo != NOWHERE ) + sDropOffGridNo = pSoldier->sGridNo; } } } @@ -5915,10 +5922,6 @@ void HandleEquipmentMove( INT16 sMapX, INT16 sMapY, INT8 bZ ) CHAR16 wSectorName[ 64 ]; GetShortSectorString( sMapX, sMapY, wSectorName ); - INT32 sDropOffGridNo = gMapInformation.sCenterGridNo; - if ( !GridNoOnVisibleWorldTile( sDropOffGridNo ) ) - sDropOffGridNo = RandomGridNo(); - WORLDITEM* pWorldItem_Target = NULL; // now loop over all sectors from which we take stuff, and move the equipment