Add: NewGRF Badges.

This commit is contained in:
Peter Nelson
2024-10-10 22:18:01 +01:00
committed by Peter Nelson
parent ca3b5ed6c1
commit 8f14894024
46 changed files with 1224 additions and 54 deletions

View File

@@ -10,6 +10,7 @@
#include "stdafx.h"
#include "debug.h"
#include "landscape.h"
#include "newgrf_badge.h"
#include "newgrf_house.h"
#include "newgrf_spritegroup.h"
#include "newgrf_town.h"
@@ -391,6 +392,8 @@ static uint32_t GetDistanceFromNearbyHouse(uint8_t parameter, TileIndex tile, Ho
case 0x65: return 0;
case 0x66: return 0xFFFFFFFF; /* Class and ID of nearby house. */
case 0x67: return 0;
case 0x7A: return GetBadgeVariableResult(*this->ro.grffile, HouseSpec::Get(this->house_id)->badges, parameter);
}
Debug(grf, 1, "Unhandled house variable 0x{:X}", variable);
@@ -507,6 +510,8 @@ static uint32_t GetDistanceFromNearbyHouse(uint8_t parameter, TileIndex tile, Ho
* in case the newgrf was removed. */
return _house_mngr.GetGRFID(house_id);
}
case 0x7A: return GetBadgeVariableResult(*this->ro.grffile, HouseSpec::Get(this->house_id)->badges, parameter);
}
Debug(grf, 1, "Unhandled house variable 0x{:X}", variable);