Codefix: Clear m8 when making tiles.

m8 should be cleared when tiles do not use it.
This commit is contained in:
Peter Nelson
2025-10-26 17:53:49 +00:00
committed by dP
parent bb4ccb40b3
commit a588ba960d
7 changed files with 10 additions and 0 deletions

View File

@@ -287,6 +287,7 @@ inline void MakeIndustry(Tile t, IndustryID index, IndustryGfx gfx, uint8_t rand
SetWaterClass(t, wc);
SB(t.m6(), 6, 2, 0);
t.m7() = 0;
t.m8() = 0;
}
#endif /* INDUSTRY_MAP_H */

View File

@@ -82,6 +82,7 @@ inline void MakeObject(Tile t, Owner o, ObjectID index, WaterClass wc, uint8_t r
t.m5() = index.base() >> 16;
SB(t.m6(), 2, 6, 0);
t.m7() = 0;
t.m8() = 0;
}
#endif /* OBJECT_MAP_H */

View File

@@ -621,6 +621,7 @@ inline void MakeRoadNormal(Tile t, RoadBits bits, RoadType road_rt, RoadType tra
t.m5() = (road_rt != INVALID_ROADTYPE ? bits : 0) | ROAD_TILE_NORMAL << 6;
SB(t.m6(), 2, 6, 0);
t.m7() = 0;
t.m8() = 0;
SetRoadTypes(t, road_rt, tram_rt);
SetRoadOwner(t, RTT_TRAM, tram);
}

View File

@@ -386,6 +386,7 @@ inline void MakeHouseTile(Tile t, TownID tid, uint8_t counter, uint8_t stage, Ho
SetHouseProtected(t, house_protected);
SetAnimationFrame(t, 0);
SetHouseProcessingTime(t, HouseSpec::Get(type)->processing_time);
SB(t.m8(), 12, 4, 0);
}
#endif /* TOWN_MAP_H */

View File

@@ -252,6 +252,7 @@ inline void MakeTree(Tile t, TreeType type, uint count, TreeGrowthStage growth,
t.m5() = count << 6 | static_cast<uint>(growth);
SB(t.m6(), 2, 6, 0);
t.m7() = 0;
t.m8() = 0;
}
#endif /* TREE_MAP_H */

View File

@@ -27,6 +27,7 @@ inline void MakeVoid(Tile t)
t.m5() = 0;
t.m6() = 0;
t.m7() = 0;
t.m8() = 0;
}
#endif /* VOID_MAP_H */

View File

@@ -393,6 +393,7 @@ inline void MakeShore(Tile t)
SetWaterTileType(t, WATER_TILE_COAST);
SB(t.m6(), 2, 6, 0);
t.m7() = 0;
t.m8() = 0;
}
/**
@@ -415,6 +416,7 @@ inline void MakeWater(Tile t, Owner o, WaterClass wc, uint8_t random_bits)
SetWaterTileType(t, WATER_TILE_CLEAR);
SB(t.m6(), 2, 6, 0);
t.m7() = 0;
t.m8() = 0;
}
/**
@@ -470,6 +472,7 @@ inline void MakeShipDepot(Tile t, Owner o, DepotID did, DepotPart part, Axis a,
SetWaterTileType(t, WATER_TILE_DEPOT);
SB(t.m6(), 2, 6, 0);
t.m7() = 0;
t.m8() = 0;
}
/**
@@ -494,6 +497,7 @@ inline void MakeLockTile(Tile t, Owner o, LockPart part, DiagDirection dir, Wate
SetWaterTileType(t, WATER_TILE_LOCK);
SB(t.m6(), 2, 6, 0);
t.m7() = 0;
t.m8() = 0;
}
/**