[Freeciv-Dev] Re: (PR#4815) failed assertion in client goto
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Jason Short wrote:
> I suspect the assertions are spurious. Too bad there's no comment
> explaining why they're there. Really, I don't understand why they
> didn't always fail. These values are initialized when you enter the
> goto state, and never unitialized. What am I missing?
Ahh. They are set to NULL by pft_fill_[default|unit]_parameter. I
suppose this means they're always spurious. But since I don't know why
they were there in the first place, maybe they should be kept around?
jason
? rc
Index: client/goto.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/goto.c,v
retrieving revision 1.56
diff -u -r1.56 goto.c
--- client/goto.c 2003/08/11 02:31:38 1.56
+++ client/goto.c 2003/08/11 03:06:09
@@ -364,7 +364,9 @@
{
pft_fill_default_parameter(parameter);
pft_fill_unit_parameter(parameter, punit);
+ assert(goto_map.template.get_EC == NULL);
parameter->get_EC = get_EC;
+ assert(goto_map.template.get_TB == NULL);
if (unit_type(punit)->attack_strength > 0) {
parameter->get_TB = get_TB_aggr;
} else {
@@ -389,8 +391,6 @@
goto_map.unit_id = punit->id;
assert(goto_map.num_parts == 0);
- assert(goto_map.template.get_EC == NULL);
- assert(goto_map.template.get_TB == NULL);
fill_client_goto_parameter(punit, &goto_map.template);
add_part();
|
|