1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Simplified building ID logic

- Replaced overcomplicated and broken math on dwelling ID's with fixed
enum
- Fixed broken 2nd upgrades and 8th dwelling
- Removed no longer used enumeration values from building ID's
This commit is contained in:
Ivan Savenko
2024-12-25 19:16:21 +00:00
parent 4e4135cd6d
commit 65fc50d33b
8 changed files with 60 additions and 69 deletions

View File

@@ -2083,7 +2083,7 @@ bool CGameHandler::buildStructure(ObjectInstanceID tid, BuildingID requestedID,
//Performs stuff that has to be done before new building is built
auto processBeforeBuiltStructure = [t, this](const BuildingID buildingID)
{
if(buildingID >= BuildingID::DWELL_FIRST) //dwelling
if(buildingID.IsDwelling())
{
int level = BuildingID::getLevelFromDwelling(buildingID);
int upgradeNumber = BuildingID::getUpgradedFromDwelling(buildingID);