From fad28c0bd181138d7c7a2be6133a16df46e58a71 Mon Sep 17 00:00:00 2001 From: Olaf Wolters Date: Tue, 2 Jan 2024 10:32:32 +0100 Subject: [PATCH] Fix GetAllForticationGridNo It was still returning gridnos as 16-bit integers. --- Tactical/DisplayCover.cpp | 6 +++--- Tactical/Handle Items.cpp | 4 ++-- Tactical/Handle Items.h | 5 +++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Tactical/DisplayCover.cpp b/Tactical/DisplayCover.cpp index 7d1a36764..f89863a9c 100644 --- a/Tactical/DisplayCover.cpp +++ b/Tactical/DisplayCover.cpp @@ -1717,10 +1717,10 @@ BOOLEAN TrackerTileHasAdjTile( const INT32& ubX, const INT32& ubY, const INT32& void CalculateFortify( ) { // simply get all fortified gridnos and colour them - std::vector< std::pair > > vec = GetAllForticationGridNo( ); + auto vec = GetAllForticationGridNo(); - std::vector< std::pair > >::iterator itend = vec.end( ); - for ( std::vector< std::pair > >::iterator it = vec.begin( ); it != itend; ++it ) + auto itend = vec.end(); + for (auto it = vec.begin(); it != itend; ++it) { INT16 sX, sY; ConvertGridNoToXY( (*it).first, &sX, &sY ); diff --git a/Tactical/Handle Items.cpp b/Tactical/Handle Items.cpp index 49036979e..7e9c6476d 100644 --- a/Tactical/Handle Items.cpp +++ b/Tactical/Handle Items.cpp @@ -8713,9 +8713,9 @@ void AddFortificationPlanNode( INT32 sGridNo, INT8 sLevel, INT16 sFortificationS UpdateFortificationPossibleAmount(); } -std::vector< std::pair > > GetAllForticationGridNo( ) +GetAllForticationGridNoResult GetAllForticationGridNo() { - std::vector< std::pair > > gridnovector; + GetAllForticationGridNoResult gridnovector; if ( !gWorldSectorX || !gWorldSectorY ) return gridnovector; diff --git a/Tactical/Handle Items.h b/Tactical/Handle Items.h index b9b208653..cdc362b31 100644 --- a/Tactical/Handle Items.h +++ b/Tactical/Handle Items.h @@ -320,7 +320,8 @@ void AddFortificationPlanNode( INT32 sGridNo, INT8 sLevel, INT16 sFortificationS void LoadSectorFortificationPlan( INT16 sSectorX, INT16 sSectorY, INT8 sSectorZ ); void SaveSectorFortificationPlan( INT16 sSectorX, INT16 sSectorY, INT8 sSectorZ ); -std::vector< std::pair > > GetAllForticationGridNo( ); +using GetAllForticationGridNoResult = std::vector< std::pair > >; +GetAllForticationGridNoResult GetAllForticationGridNo(); INT32 GetFirstObjectInSectorPosition( UINT16 ausItem ); @@ -334,4 +335,4 @@ BOOLEAN SpendMoney( SOLDIERTYPE *pSoldier, UINT32 aAmount ); // character spen // Flugente: intel void TakePhoto( SOLDIERTYPE* pSoldier, INT32 sGridNo, INT8 bLevel ); -#endif \ No newline at end of file +#endif