From 5733a5ba623fbbaaa8c96bbdfb1dac49b8d47e2a Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 4 Feb 2022 22:46:58 +0200 Subject: [PATCH 6/6] Fix removing resource extras tile_remove_extra() was removing resources only from the "active extras" bitvector, but leaving them in as a dormant resource. As the terrain was suitable for the resource all along, it reactivated immediately. Reported by ddeanbrown See osdn #43782 Signed-off-by: Marko Lindqvist --- common/tile.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/tile.c b/common/tile.c index 38e7638ad1..cbd9805cd7 100644 --- a/common/tile.c +++ b/common/tile.c @@ -982,6 +982,9 @@ void tile_remove_extra(struct tile *ptile, const struct extra_type *pextra) { if (pextra != NULL) { BV_CLR(ptile->extras, extra_index(pextra)); + if (ptile->resource == pextra) { + ptile->resource = NULL; + } } } -- 2.34.1