From c2298235506ff6ada462f2305f6843f2115d1996 Mon Sep 17 00:00:00 2001 From: Tyler Trahan Date: Tue, 1 Jul 2025 13:57:16 -0400 Subject: [PATCH] Fix: Player-placed house protection for houses should override the callback --- src/newgrf_house.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/newgrf_house.cpp b/src/newgrf_house.cpp index 565927aaa7..6d507be6f4 100644 --- a/src/newgrf_house.cpp +++ b/src/newgrf_house.cpp @@ -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; } /**