Re: [Freeciv-Dev] (PR#15854) goto.c:860: Assertion `unit_is_in_focus(punit)' failed
URL: http://bugs.freeciv.org/Ticket/Display.html?id=15854 Check the top/left corner of the page. If that would have worked, I wouldnt have asked ;) Ingo ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#15854) goto.c:860: Assertion `unit_is_in_focus(punit)' failed
URL: http://bugs.freeciv.org/Ticket/Display.html?id=15854 On 05/09/07, Pepeto _ wrote: It occurs when the server wake up an unit (which was sentried) whereas you are selecting a destination for an other unit. Patch The client crashes every time a enemy unit moves. Most enemy moves are not causing focus changes... Still, how usable goto is if hover is often automatically canceled when you try to setup it? I don't see better solution available soon, so this just replaces crash with hover cancel. - ML diff -Nurd -X.diff_ignore freeciv/client/control.c freeciv/client/control.c --- freeciv/client/control.c 2007-09-02 05:15:11.0 +0300 +++ freeciv/client/control.c 2007-09-09 01:36:49.0 +0300 @@ -255,6 +255,8 @@ **/ void set_unit_focus(struct unit *punit) { + bool focus_changed = FALSE; + if (punit game.player_ptr punit-owner != game.player_ptr) { /* Callers should make sure this never happens. */ return; @@ -266,6 +268,7 @@ if (!(get_num_units_in_focus() == 1 punit == unit_list_get(get_units_in_focus(), 0))) { store_focus(); +focus_changed = TRUE; } /* Redraw the old focus unit (to fix blinking or remove the selection @@ -302,6 +305,10 @@ } } + if (focus_changed) { +set_hover_state(NULL, HOVER_NONE, ACTIVITY_LAST, ORDER_LAST); + } + update_unit_info_label(pfocus_units); update_menus(); } @@ -322,6 +329,13 @@ return; } + /* Can't change list of focused units when there is already + * set of goto lines calculated. */ + assert(hover_state == HOVER_NONE); + if (hover_state != HOVER_NONE) { +return; + } + unit_list_append(pfocus_units, punit); punit-focus_status = FOCUS_AVAIL; refresh_unit_mapcanvas(punit, punit-tile, TRUE, FALSE); ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#15854) goto.c:860: Assertion `unit_is_in_focus(punit)' failed
URL: http://bugs.freeciv.org/Ticket/Display.html?id=15854 On 09/09/07, Marko Lindqvist wrote: On 05/09/07, Pepeto _ wrote: It occurs when the server wake up an unit (which was sentried) whereas you are selecting a destination for an other unit. Patch Ok, it *is* possible to add focus units when goto is active. Replaced assert() with hover cancel. This is all that S2_1 needs. For trunk we may consider adding new goto_map for additional units in focus (if they are allowed to ignore already set waypoints, this should not be hard) - ML diff -Nurd -X.diff_ignore freeciv/client/control.c freeciv/client/control.c --- freeciv/client/control.c 2007-09-02 05:15:11.0 +0300 +++ freeciv/client/control.c 2007-09-09 02:45:11.0 +0300 @@ -255,6 +255,8 @@ **/ void set_unit_focus(struct unit *punit) { + bool focus_changed = FALSE; + if (punit game.player_ptr punit-owner != game.player_ptr) { /* Callers should make sure this never happens. */ return; @@ -266,6 +268,7 @@ if (!(get_num_units_in_focus() == 1 punit == unit_list_get(get_units_in_focus(), 0))) { store_focus(); +focus_changed = TRUE; } /* Redraw the old focus unit (to fix blinking or remove the selection @@ -302,6 +305,10 @@ } } + if (focus_changed) { +set_hover_state(NULL, HOVER_NONE, ACTIVITY_LAST, ORDER_LAST); + } + update_unit_info_label(pfocus_units); update_menus(); } @@ -322,6 +329,12 @@ return; } + if (hover_state != HOVER_NONE) { +/* Can't continue with current goto if set of focus units + * change. Cancel it. */ +set_hover_state(NULL, HOVER_NONE, ACTIVITY_LAST, ORDER_LAST); + } + unit_list_append(pfocus_units, punit); punit-focus_status = FOCUS_AVAIL; refresh_unit_mapcanvas(punit, punit-tile, TRUE, FALSE); ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#15854) goto.c:860: Assertion `unit_is_in_focus(punit)' failed
URL: http://bugs.freeciv.org/Ticket/Display.html?id=15854 Hello again, On Tue, 4 Sep 2007, Pepeto _ wrote: It doesn't work. I got it yesterday. But now, I know exactly how reproduce the crash. It occurs when the server wake up an unit (which was sentried) whereas you are selecting a destination for an other unit. This makes Freeciv totally unplayable for multi-player games. The client crashes every time a enemy unit moves. I can approve that the beta client crashes about 5-10 times during our weekly lan sessions. Often (but not always) when planing gotos. We were already getting used to it ;) Ingo PS: Is the guest web login for the bug reporting page broken? -- Dipl.-Math. Karl-Ingo Friese Wissenschaftlicher Mitarbeiter FG Graphische Datenverarbeitung Institut für Mensch-Maschine-Kommunikation Universität Hannover, Welfengarten 1, D-30167 Hannover http://www.gdv.uni-hannover.de Tel.: +49 (0)511-762 2913Fax.: +49 (0)511-762 2911 email: [EMAIL PROTECTED] ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev