mirror of
https://github.com/1dot13/source.git
synced 2026-09-02 14:36:06 +02:00
Fix: constructing/deconstructing a fortifiaction only worked if the tileset was part of the additonal tileset, not if it was a part of GENERIC 1
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7938 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -6878,7 +6878,8 @@ BOOLEAN BuildFortification( INT32 sGridNo, SOLDIERTYPE *pSoldier, OBJECTTYPE *pO
|
|||||||
// search wether structure exists in the current tilesets. If not, well, too bad
|
// search wether structure exists in the current tilesets. If not, well, too bad
|
||||||
for (UINT32 uiType = 0; uiType < giNumberOfTileTypes; ++uiType)
|
for (UINT32 uiType = 0; uiType < giNumberOfTileTypes; ++uiType)
|
||||||
{
|
{
|
||||||
if( gTilesets[ giCurrentTilesetID ].TileSurfaceFilenames[ uiType ][0] )
|
// if tileset is from the current tileset, check that
|
||||||
|
if ( gTilesets[ giCurrentTilesetID ].TileSurfaceFilenames[ uiType ][0] )
|
||||||
{
|
{
|
||||||
if ( structureconstructindex >= 0 )
|
if ( structureconstructindex >= 0 )
|
||||||
{
|
{
|
||||||
@@ -6889,6 +6890,15 @@ BOOLEAN BuildFortification( INT32 sGridNo, SOLDIERTYPE *pSoldier, OBJECTTYPE *pO
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// otherwise, check first tileset (GENERIC 1)
|
||||||
|
else if ( gTilesets[0].TileSurfaceFilenames[uiType][0] )
|
||||||
|
{
|
||||||
|
if ( !_strnicmp( gTilesets[0].TileSurfaceFilenames[uiType], gStructureConstruct[structureconstructindex].szTileSetName, 10 ) )
|
||||||
|
{
|
||||||
|
usUseObjIndex = uiType;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !usUseObjIndex )
|
if ( !usUseObjIndex )
|
||||||
@@ -6981,8 +6991,21 @@ BOOLEAN RemoveFortification( INT32 sGridNo, SOLDIERTYPE *pSoldier, OBJECTTYPE *p
|
|||||||
// item we have in our hand must be one with which we can deconstruct this
|
// item we have in our hand must be one with which we can deconstruct this
|
||||||
if ( pObj->usItem == gStructureDeconstruct[i].usDeconstructItem )
|
if ( pObj->usItem == gStructureDeconstruct[i].usDeconstructItem )
|
||||||
{
|
{
|
||||||
// Check if we are a sandbag or a earth pile
|
// if tileset is from the current tileset, check that
|
||||||
if ( !_strnicmp( gTilesets[ giCurrentTilesetID ].TileSurfaceFilenames[ uiTileType ], gStructureDeconstruct[i].szTileSetName, 11) )
|
BOOLEAN found = FALSE;
|
||||||
|
if ( gTilesets[giCurrentTilesetID].TileSurfaceFilenames[uiTileType][0] )
|
||||||
|
{
|
||||||
|
if ( !_strnicmp( gTilesets[giCurrentTilesetID].TileSurfaceFilenames[uiTileType], gStructureDeconstruct[i].szTileSetName, 11 ) )
|
||||||
|
found = TRUE;
|
||||||
|
}
|
||||||
|
// otherwise, check first tileset (GENERIC 1)
|
||||||
|
else if ( gTilesets[0].TileSurfaceFilenames[uiTileType][0] )
|
||||||
|
{
|
||||||
|
if ( !_strnicmp( gTilesets[0].TileSurfaceFilenames[uiTileType], gStructureDeconstruct[i].szTileSetName, 11 ) )
|
||||||
|
found = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( found )
|
||||||
{
|
{
|
||||||
// we have to check wether this specific structure can be removed. Just checking the tileset name won't be enough.
|
// we have to check wether this specific structure can be removed. Just checking the tileset name won't be enough.
|
||||||
// For example, we could have a set consisting of crates and piles of earth, which we want to remove via applying a shovel on it.
|
// For example, we could have a set consisting of crates and piles of earth, which we want to remove via applying a shovel on it.
|
||||||
|
|||||||
Reference in New Issue
Block a user