1
0
Fork 0

Compare commits

...

2 Commits

Author SHA1 Message Date
Tyler Trahan c074a3db74
Merge c229823550 into aaf5d39b15 2025-07-11 04:47:50 +00:00
Tyler Trahan c229823550 Fix: Player-placed house protection for houses should override the callback 2025-07-01 13:57:16 -04:00
1 changed files with 6 additions and 2 deletions

View File

@ -595,12 +595,16 @@ bool CanDeleteHouse(TileIndex tile)
return true;
}
/* The house might be placed by a player or protected by the GRF house flag. */
if (IsHouseProtected(tile)) return false;
/* Check the callback result, if the house uses it. */
if (hs->callback_mask.Test(HouseCallbackMask::DenyDestruction)) {
uint16_t callback_res = GetHouseCallback(CBID_HOUSE_DENY_DESTRUCTION, 0, 0, GetHouseType(tile), Town::GetByTile(tile), tile);
return (callback_res == CALLBACK_FAILED || !ConvertBooleanCallback(hs->grf_prop.grffile, CBID_HOUSE_DENY_DESTRUCTION, callback_res));
} else {
return !IsHouseProtected(tile);
}
return true;
}
/**