mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Added a function that quickly identifies whether a tileset contains a specific tileset
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8053 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -6878,6 +6878,32 @@ void SoldierStealItemFromSoldier( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent,
|
||||
SetCustomizableTimerCallbackAndDelay( 1000, CheckForPickedOwnership, TRUE );
|
||||
}
|
||||
|
||||
INT16 GetTileSetTindexToTileSetName( INT32 asTileSetId, std::string aTileSetName )
|
||||
{
|
||||
// search wether structure exists in the current tilesets. If not, well, too bad
|
||||
for ( INT16 iType = 0; iType < giNumberOfTileTypes; ++iType )
|
||||
{
|
||||
// if tileset is from the current tileset, check that
|
||||
if ( gTilesets[asTileSetId].TileSurfaceFilenames[iType][0] )
|
||||
{
|
||||
if ( !strcmp( aTileSetName.c_str( ), gTilesets[asTileSetId].TileSurfaceFilenames[iType] ) )
|
||||
{
|
||||
return iType;
|
||||
}
|
||||
}
|
||||
// otherwise, check first tileset (GENERIC 1)
|
||||
else if ( gTilesets[0].TileSurfaceFilenames[iType][0] )
|
||||
{
|
||||
if ( !strcmp( aTileSetName.c_str( ), gTilesets[0].TileSurfaceFilenames[iType] ) )
|
||||
{
|
||||
return iType;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
// can we construct a structure with this item?
|
||||
BOOLEAN IsStructureConstructItem(UINT16 usItem, INT32 sGridNo, SOLDIERTYPE* pSoldier)
|
||||
{
|
||||
|
||||
@@ -207,7 +207,8 @@ UINT8 StealItems(SOLDIERTYPE* pSoldier,SOLDIERTYPE* pOpponent, UINT8* ubIndexRet
|
||||
|
||||
BOOLEAN MarblesExistAtLocation( INT32 sGridNo, UINT8 ubLevel, INT32 * piItemIndex );
|
||||
|
||||
// Flugente: build an deconstruct structures
|
||||
// Flugente: build and deconstruct structures
|
||||
INT16 GetTileSetTindexToTileSetName( INT32 asTileSetId, std::string aTileSetName );
|
||||
BOOLEAN IsStructureConstructItem( UINT16 usItem, INT32 sGridNo, SOLDIERTYPE* pSoldier ); // can we construct a structure with this item?
|
||||
BOOLEAN IsStructureDeconstructItem( UINT16 usItem, INT32 sGridNo, SOLDIERTYPE* pSoldier ); // can we remove a structure with this item?
|
||||
BOOLEAN BuildFortification( INT32 sGridNo, SOLDIERTYPE *pSoldier, OBJECTTYPE *pObj ); // build a structure, return true if sucessful
|
||||
|
||||
Reference in New Issue
Block a user