Follow-up Comment #4, bug #18529 (project freeciv):

Confirmed that my "simplest" fix doesn't help when building a city on top of
a fortress.

It seems the only safe time to do the destroy_base() is before the city is
created, or at any rate before tile_set_worked(ptile, pcity) (which "plumbs it
in" to the tile), because destroy_base() can call map_clear_border(), which
calls tile_border_source_radius_sq(), which picks up on the city if it exists
at that point rather than the base. (There's probably a different bug if more
than one border claiming base is on a tile and one is destroyed, too.)

Attached patch (which I'll commit immediately) calls destroy_base() before
even create_city_virtual(), because that's most obviously safe. It might lead
to unnecessary vision updates sent to clients as the vision source is removed
and a different one reinstated, but I suspect it's a major rework to optimise

(IMO the borders and vision stuff needs a good cleaning; I've had at least
one project stall due to getting tangled up in it.)

(file #14023, file #14024)

Additional Item Attachment:

File name: S2_3-build-city-destroy-base-quickfix.diff Size:1 KB
File name: trunk-build-city-destroy-base-quickfix.diff Size:1 KB


Reply to this item at:


  Message sent via/by Gna!

Freeciv-dev mailing list

Reply via email to