URL:
<http://gna.org/bugs/?16187>
Summary: Duff assertion in set_unit_activity_targeted()
Project: Freeciv
Submitted by: jtn
Submitted on: Tuesday 06/22/10 at 00:19
Category: None
Severity: 2 - Minor
Priority: 5 - Normal
Status: Ready For Test
Assigned to: jtn
Originator Email:
Open/Closed: Open
Release: 2.2.1
Discussion Lock: Any
Operating System: None
Planned Release: 2.2.2
_______________________________________________________
Details:
assert(new_target != ACTIVITY_FORTRESS
&& new_target != ACTIVITY_AIRBASE);
Since new_target is of type "enum tile_special_type", it's not appropriate to
compare to ACTIVITY_* from "enum unit_activity".
By luck ACTIVITY_FORTRESS = 6 = S_OLD_FORTRESS, and ACTIVITY_AIRBASE = 14
which is not currently a valid special. So this assertion is merely slightly
ineffectual, rather than firing in valid circumstances.
Since this function is about targeted activity, I'll change it to
S_OLD_FORTRESS/AIRBASE, and add a new assertion to set_unit_activity() for
ACTIVITY_FORTRESS/AIRBASE.
The came onto trunk in r12807 (part of bases implementation).
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Tuesday 06/22/10 at 00:19 Name: trunk-base-assertion.diff Size: 941B
By: jtn
r17498: replace bogus assertion with two
<http://gna.org/bugs/download.php?file_id=9357>
-------------------------------------------------------
Date: Tuesday 06/22/10 at 00:19 Name: S2_2-base-assertion.diff Size: 899B
By: jtn
r17498: replace bogus assertion with two
<http://gna.org/bugs/download.php?file_id=9356>
_______________________________________________________
Reply to this item at:
<http://gna.org/bugs/?16187>
_______________________________________________
Message sent via/by Gna!
http://gna.org/
_______________________________________________
Freeciv-dev mailing list
[email protected]
https://mail.gna.org/listinfo/freeciv-dev