[Freeciv-Dev] server crashed upgrading a frigate (PR#6735)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=6735 >
I like the concept of Raimar's latest patch. Here's a rework of it:
- I removed upgrade_would_strand. This function is now unneeded since
it is a less strict check than the (simpler) one that is done. (Because
punit->transported_by is now enforced strictly, we would have to
actually reassign the units in upgrade_unit if we wanted to do the less
strict check.) Also, this is a duplicate of
ground_unit_transporter_capacity, so this function shouldn't exist in
any case.
- I renamed unit_upgrade as test_unit_upgrade. Note that it has no side
effects now.
- Rather than pass separate need_city and need_gold parameters to
upgrade_unit and test-unit_upgrade, I just pass a single parameter:
is_free. This is TRUE for Leonardo's, FALSE everywhere else. It allows
a more understandable interface and a stricter assertion within
upgrade_unit.
- I do not pass to_unittype to test_unit_upgrade. Rather, this function
retrieves the unittype itself and returns UR_NO_UNITTYPE if it's
invalid. It would be okay with me if we did pass the unittype in to the
function (the way I have it now there is potential for error, since the
unittype used by test_unit_upgrade is generated differently from the one
the callers are using), but we definitely need to verify this value and
have a UR_NO_UNITTYPE return value.
- New functiong get_unit_upgrade_info is added to citydlg_common. This
makes the GUI code very simple.
- Added support for gui-gtk-2.0, gui-win32, and gui-xaw. gui-gtk code
is updated. gui-sdl is unsupported (but will still work just fine).
- Maybe something else I forgot about.
Tested under some, but not all GUIs.
jason
|
|