diff --git a/Strategic/Assignments.cpp b/Strategic/Assignments.cpp index 809ee2d1..e843d538 100644 --- a/Strategic/Assignments.cpp +++ b/Strategic/Assignments.cpp @@ -7139,9 +7139,9 @@ void HandleEquipmentMove( INT16 sMapX, INT16 sMapY, INT8 bZ ) std::map > sectormercmap; // this map uses the sectors we take stuff from as keys and the number of mercs as elements // we need a gridno to which we drop stuff - INT32 sDropOffGridNo = gMapInformation.sCenterGridNo; - if ( !GridNoOnVisibleWorldTile( sDropOffGridNo ) ) - sDropOffGridNo = RandomGridNo(); + INT32 sDropOffGridNo = NOWHERE; + if ( (gWorldSectorX == sMapX) && (gWorldSectorY == sMapY) && (gbWorldSectorZ == bZ) ) + sDropOffGridNo = gMapInformation.sCenterGridNo; SOLDIERTYPE *pSoldier = NULL; UINT32 uiCnt = 0; @@ -7176,7 +7176,7 @@ void HandleEquipmentMove( INT16 sMapX, INT16 sMapY, INT8 bZ ) sectormercmap[targetsector] = pair; } - if ( pSoldier->sGridNo != NOWHERE ) + if ( TileIsOutOfBounds(sDropOffGridNo) && !TileIsOutOfBounds( pSoldier->sGridNo ) ) sDropOffGridNo = pSoldier->sGridNo; } } @@ -7185,10 +7185,17 @@ void HandleEquipmentMove( INT16 sMapX, INT16 sMapY, INT8 bZ ) // no mercs that move stuff here, exit if ( sectormercmap.empty() ) return; - + CHAR16 wSectorName[ 64 ]; GetShortSectorString( sMapX, sMapY, wSectorName ); + // if we don't have a valid spot to drop gear at, don't do so - better than having tons of items unreachable + if ( TileIsOutOfBounds( sDropOffGridNo ) ) + { + ScreenMsg( FONT_MCOLOR_RED, MSG_INTERFACE, pMapErrorString[50], wSectorName ); + return; + } + std::vector pWorldItem_Target;//dnl ch75 271013 // now loop over all sectors from which we take stuff, and move the equipment @@ -7336,7 +7343,7 @@ void HandleEquipmentMove( INT16 sMapX, INT16 sMapY, INT8 bZ ) CHAR16 wSectorName_Target[ 64 ]; GetShortSectorString( targetX, targetY, wSectorName_Target ); - ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%d items moved from %s to %s", moveditems, wSectorName_Target, wSectorName ); + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMapErrorString[51], moveditems, wSectorName_Target, wSectorName ); // if we didn't move any item, no need to save a changed inventory etc. if ( !moveditems ) diff --git a/Utils/_ChineseText.cpp b/Utils/_ChineseText.cpp index bd56165d..c0b601bf 100644 --- a/Utils/_ChineseText.cpp +++ b/Utils/_ChineseText.cpp @@ -4670,6 +4670,9 @@ STR16 pMapErrorString[] = L"车辆被损坏得太严重了!", L"每个分区只能由两名佣兵来训练民兵。", L"没有遥控员,机器人无法移动。请把他们分配在同一个小队。", + L"Items cannot be moved to %s, as no valid dropoff point was found. Please enter map to resolve this issue.", // TODO.Translate +// 51-55 + L"%d items moved from %s to %s", }; diff --git a/Utils/_DutchText.cpp b/Utils/_DutchText.cpp index e2d2c78b..e5eb6c97 100644 --- a/Utils/_DutchText.cpp +++ b/Utils/_DutchText.cpp @@ -4672,6 +4672,9 @@ STR16 pMapErrorString[] = L"Voertuig is te beschadigd!", L"Let op dat maar twee huurlingen milities in een sector mogen trainen.", L"De robot kan zich zonder bediening niet verplaatsen. Plaats ze in hetzelfde team.", + L"Items cannot be moved to %s, as no valid dropoff point was found. Please enter map to resolve this issue.", // TODO.Translate +// 51-55 + L"%d items moved from %s to %s", }; diff --git a/Utils/_EnglishText.cpp b/Utils/_EnglishText.cpp index 49235d4c..f39890b3 100644 --- a/Utils/_EnglishText.cpp +++ b/Utils/_EnglishText.cpp @@ -4667,6 +4667,9 @@ STR16 pMapErrorString[] = L"Vehicle is too damaged!", L"Note that only two mercs may train militia in each sector.", L"The robot can't move without its controller. Place them together in the same squad.", + L"Items cannot be moved to %s, as no valid dropoff point was found. Please enter map to resolve this issue.", +// 51-55 + L"%d items moved from %s to %s", }; diff --git a/Utils/_FrenchText.cpp b/Utils/_FrenchText.cpp index 373f32d0..cdd78abd 100644 --- a/Utils/_FrenchText.cpp +++ b/Utils/_FrenchText.cpp @@ -4675,6 +4675,9 @@ STR16 pMapErrorString[] = L"Le véhicule est trop endommagé !", L"Deux mercenaires au plus peuvent être assignés à l'entraînement de la milice dans chaque secteur.", L"Le robot ne peut se déplacer sans son contrôleur. Mettez-les ensemble dans la même escouade.", + L"Items cannot be moved to %s, as no valid dropoff point was found. Please enter map to resolve this issue.", // TODO.Translate +// 51-55 + L"%d items moved from %s to %s", }; diff --git a/Utils/_GermanText.cpp b/Utils/_GermanText.cpp index f52b5013..20e6726b 100644 --- a/Utils/_GermanText.cpp +++ b/Utils/_GermanText.cpp @@ -4639,7 +4639,9 @@ STR16 pMapErrorString[] = L"Fahrzeug zu stark beschädigt!", L"Nur zwei Söldner pro Sektor können Milizen trainieren.", L"Roboter muss von jemandem bedient werden. Beide im selben Trupp platzieren.", - + L"Items cannot be moved to %s, as no valid dropoff point was found. Please enter map to resolve this issue.", // TODO.Translate +// 51-55 + L"%d Gegenstände von %s nach %s bewegt", }; // help text used during strategic route plotting diff --git a/Utils/_ItalianText.cpp b/Utils/_ItalianText.cpp index 8291b371..b5b18084 100644 --- a/Utils/_ItalianText.cpp +++ b/Utils/_ItalianText.cpp @@ -4665,6 +4665,9 @@ STR16 pMapErrorString[] = L"Il veicolo è troppo danneggiato!", L"Osservate che solo due mercenari potrebbero addestrare i militari in questo settore.", L"Il robot non può muoversi senza il suo controller. Metteteli nella stessa squadra.", + L"Items cannot be moved to %s, as no valid dropoff point was found. Please enter map to resolve this issue.", // TODO.Translate +// 51-55 + L"%d items moved from %s to %s", }; diff --git a/Utils/_PolishText.cpp b/Utils/_PolishText.cpp index 0db5a55e..3d1d5eb1 100644 --- a/Utils/_PolishText.cpp +++ b/Utils/_PolishText.cpp @@ -4676,6 +4676,9 @@ STR16 pMapErrorString[] = L"Pojazd jest uszkodzony!", L"Pamiętaj, że w jednym sektorze tylko dwóch najemników może trenować żołnierzy samoobrony.", L"Robot nie może się poruszać bez operatora. Umieść ich razem w jednym oddziale.", + L"Items cannot be moved to %s, as no valid dropoff point was found. Please enter map to resolve this issue.", // TODO.Translate +// 51-55 + L"%d items moved from %s to %s", }; diff --git a/Utils/_RussianText.cpp b/Utils/_RussianText.cpp index 9400599f..4f64489b 100644 --- a/Utils/_RussianText.cpp +++ b/Utils/_RussianText.cpp @@ -4667,6 +4667,9 @@ STR16 pMapErrorString[] = L"Машина сильно повреждена!", L"Внимание! Тренировать ополченцев в одном секторе могут не более двух наёмников.", L"Роботом обязательно нужно управлять. Назначьте наёмника с пультом и робота в один отряд.", + L"Items cannot be moved to %s, as no valid dropoff point was found. Please enter map to resolve this issue.", // TODO.Translate +// 51-55 + L"%d items moved from %s to %s", };