Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2000:
[Freeciv-Dev] Re: foggy problems
Home

[Freeciv-Dev] Re: foggy problems

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Jeff Mallatt <jjm@xxxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: foggy problems
From: Thue Janus Kristesnsen <thue@xxxxxxx>
Date: Mon, 10 Apr 2000 20:05:43 +0200

[...]
> Finally, here are my thoughts as to the direct cause of the infinite
loop > bug:  When resolve_unit_stack() is called in this situation (from
> transfer_city() and transfer_city_units()), it is possible for pcity to be
> at the same location as punit.  This leads to punit not moving (because it
> already is in the closest city), and (having not moved) being itself the
> next unit in the list to try to move, which it never does... loop...
> However, I don't think this needs to be changed.
[...]

But we here call transfer_city_units in the middle of transfer_city, and
both players have a city in the same square, thought only one is referred
to from the tile. (the old one)
So we happily transfer the units to the same square, apperantly
in such a way that they enter each others cities just created (I imagine
it eats up RAM as well)

The attached patch does the following:
1) Temporarely removes the old city from the victim players city list
while the units are transferred (the old city is still the one referred
in the tile, but it would take some ogy code to change that in the too,
as we would have to go throught the playermaps as well). This is needed
for the units to be transferred properly (My main test case was a ship
city1 with a unit from city2 just outside city1 as it got bribed, the
unit gets into the city too). If you want to I think we can allow
resolving units in a city again. Yes, I know this isn't very pretty, but
I couldn't see any other way.
Suggestions welcome.

2) Make sure that ships are not transferred to landlocked cities

3) Make the server not crash if we try to transfer a unit when we have no
cities.

4) Move the verbose message to the player from resolve_unitstack down into
teleport_unit_to_city

-Thue

Attachment: transfer_problems-Apr-10.diff
Description: Text Data


[Prev in Thread] Current Thread [Next in Thread]