Follow-up Comment #5, bug #19467 (project freeciv):
That assert is a bit overzealous. For supporting NULL ptile parameter just one
check has to be added. Otherwise NULL gets passed to underlying functions that
work with it exactly as I were expecting - NULL ptile is a feature. Attached
fix makes get_unittype_bonus() to work with NULL ptile and removes part
checking against it from the assert. I'm a bit undecided if assert should be
removed completely, along with similar asserts from other members of the
function family. Passing such NULL parameters does make sense in some
situations, but maybe it's more robust (or at least gives more consistent
end-user-experience) to avoid them when possible.
Additional Item Attachment:
File name: HpLossUnitAssertFix.diff Size:1 KB
Reply to this item at:
Message sent via/by Gna!
Freeciv-dev mailing list