Fix GetAllForticationGridNo (#259)

It was still returning gridnos as 16-bit integers.
This commit is contained in:
olafwqq
2024-01-02 11:53:29 +02:00
committed by GitHub
parent 4d09bea13e
commit fd4b531d53
3 changed files with 8 additions and 7 deletions
+3 -3
View File
@@ -1717,10 +1717,10 @@ BOOLEAN TrackerTileHasAdjTile( const INT32& ubX, const INT32& ubY, const INT32&
void CalculateFortify( ) void CalculateFortify( )
{ {
// simply get all fortified gridnos and colour them // simply get all fortified gridnos and colour them
std::vector< std::pair<INT16, std::pair<UINT8, INT8> > > vec = GetAllForticationGridNo( ); auto vec = GetAllForticationGridNo();
std::vector< std::pair<INT16, std::pair<UINT8, INT8> > >::iterator itend = vec.end( ); auto itend = vec.end();
for ( std::vector< std::pair<INT16, std::pair<UINT8, INT8> > >::iterator it = vec.begin( ); it != itend; ++it ) for (auto it = vec.begin(); it != itend; ++it)
{ {
INT16 sX, sY; INT16 sX, sY;
ConvertGridNoToXY( (*it).first, &sX, &sY ); ConvertGridNoToXY( (*it).first, &sX, &sY );
+2 -2
View File
@@ -8713,9 +8713,9 @@ void AddFortificationPlanNode( INT32 sGridNo, INT8 sLevel, INT16 sFortificationS
UpdateFortificationPossibleAmount(); UpdateFortificationPossibleAmount();
} }
std::vector< std::pair<INT16, std::pair<UINT8, INT8> > > GetAllForticationGridNo( ) GetAllForticationGridNoResult GetAllForticationGridNo()
{ {
std::vector< std::pair<INT16, std::pair<UINT8, INT8> > > gridnovector; GetAllForticationGridNoResult gridnovector;
if ( !gWorldSectorX || !gWorldSectorY ) if ( !gWorldSectorX || !gWorldSectorY )
return gridnovector; return gridnovector;
+3 -2
View File
@@ -320,7 +320,8 @@ void AddFortificationPlanNode( INT32 sGridNo, INT8 sLevel, INT16 sFortificationS
void LoadSectorFortificationPlan( INT16 sSectorX, INT16 sSectorY, INT8 sSectorZ ); void LoadSectorFortificationPlan( INT16 sSectorX, INT16 sSectorY, INT8 sSectorZ );
void SaveSectorFortificationPlan( INT16 sSectorX, INT16 sSectorY, INT8 sSectorZ ); void SaveSectorFortificationPlan( INT16 sSectorX, INT16 sSectorY, INT8 sSectorZ );
std::vector< std::pair<INT16, std::pair<UINT8, INT8> > > GetAllForticationGridNo( ); using GetAllForticationGridNoResult = std::vector< std::pair<INT32, std::pair<UINT8, INT8> > >;
GetAllForticationGridNoResult GetAllForticationGridNo();
INT32 GetFirstObjectInSectorPosition( UINT16 ausItem ); INT32 GetFirstObjectInSectorPosition( UINT16 ausItem );
@@ -334,4 +335,4 @@ BOOLEAN SpendMoney( SOLDIERTYPE *pSoldier, UINT32 aAmount ); // character spen
// Flugente: intel // Flugente: intel
void TakePhoto( SOLDIERTYPE* pSoldier, INT32 sGridNo, INT8 bLevel ); void TakePhoto( SOLDIERTYPE* pSoldier, INT32 sGridNo, INT8 bLevel );
#endif #endif