Include @andrettin's fix for regenerating wood. Fixes #136
This commit is contained in:
parent
57d63e9cd5
commit
95660e6ba9
3 changed files with 24 additions and 2 deletions
src
|
@ -123,6 +123,7 @@ public:
|
|||
unsigned int getTileCount() const { return tiles.size(); }
|
||||
|
||||
unsigned int getDefaultTileIndex() const;
|
||||
unsigned int getDefaultWoodTileIndex() const;
|
||||
|
||||
bool isAWallTile(unsigned tile) const;
|
||||
bool isARaceWallTile(unsigned tile, bool human) const;
|
||||
|
|
|
@ -589,7 +589,7 @@ void CMap::RegenerateForestTile(const Vec2i &pos)
|
|||
&& topMf.Value >= ForestRegeneration
|
||||
&& !(topMf.Flags & occupedFlag)) {
|
||||
DebugPrint("Real place wood\n");
|
||||
topMf.setTileIndex(*Map.Tileset, Map.Tileset->getTopOneTreeTile(), 0);
|
||||
topMf.setTileIndex(*Map.Tileset, Map.Tileset->getDefaultWoodTileIndex(), 0);
|
||||
topMf.setGraphicTile(Map.Tileset->getTopOneTreeTile());
|
||||
topMf.playerInfo.SeenTile = topMf.getGraphicTile();
|
||||
topMf.Value = 0;
|
||||
|
@ -598,7 +598,7 @@ void CMap::RegenerateForestTile(const Vec2i &pos)
|
|||
UI.Minimap.UpdateXY(pos + offset);
|
||||
|
||||
|
||||
mf.setTileIndex(*Map.Tileset, Map.Tileset->getBottomOneTreeTile(), 0);
|
||||
mf.setTileIndex(*Map.Tileset, Map.Tileset->getDefaultWoodTileIndex(), 0);
|
||||
mf.setGraphicTile(Map.Tileset->getBottomOneTreeTile());
|
||||
mf.playerInfo.SeenTile = mf.getGraphicTile();
|
||||
mf.Value = 0;
|
||||
|
|
|
@ -230,6 +230,27 @@ unsigned int CTileset::getDefaultTileIndex() const
|
|||
return 0x50;
|
||||
}
|
||||
|
||||
unsigned int CTileset::getDefaultWoodTileIndex() const
|
||||
{
|
||||
const int n = tiles.size();
|
||||
int solid = 0;
|
||||
for (int i = 0; i < n;) {
|
||||
const CTile &tile = tiles[i];
|
||||
const CTileInfo &tileinfo = tile.tileinfo;
|
||||
if (tileinfo.BaseTerrain && tileinfo.MixTerrain) {
|
||||
i += 256;
|
||||
} else {
|
||||
if (tileinfo.BaseTerrain != 0 && tileinfo.MixTerrain == 0) {
|
||||
if (tile.flag & MapFieldForest) {
|
||||
solid = i;
|
||||
}
|
||||
}
|
||||
i += 16;
|
||||
}
|
||||
}
|
||||
return solid;
|
||||
}
|
||||
|
||||
bool CTileset::isAWallTile(unsigned tile) const
|
||||
{
|
||||
if (TileTypeTable.empty() == false) {
|
||||
|
|
Loading…
Add table
Reference in a new issue