Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2005:
[Freeciv-Dev] Re: (PR#10843) Fight animation
Home

[Freeciv-Dev] Re: (PR#10843) Fight animation

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: chrisk@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#10843) Fight animation
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 24 Aug 2005 19:20:58 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=10843 >

Christian Knoke wrote:

> fight animation is not displayed for my attacking unit (see unit loosing
> hitpoints) when the unit icons blink phase is dark.

The attached patch fixes this for 2.0.

At first I thought we should add a special-case in get_drawable_unit for 
attacking/defending units.  This meant get_drawable_unit and friends had 
to be moved from tilespec.c into control.c.  Not too hard...the problem 
is after the animation the unit will just disappear again if it's in an 
"off" blink state.

Easier is just to make sure the unit isn't hidden when 
set_units_in_combat is called.

Fixing this for the development version is a bit harder because we have 
to worry about unit-selection animation.  There is no 
set_focus_unit_hidden_state function.  We could still move all these 
functions into control.c but there's a bit more of them now.  Maybe this 
calls for a bit of redesign...

-jason

Index: client/control.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/control.c,v
retrieving revision 1.143.2.13
diff -p -u -r1.143.2.13 control.c
--- client/control.c    26 May 2005 04:55:19 -0000      1.143.2.13
+++ client/control.c    25 Aug 2005 02:09:45 -0000
@@ -455,6 +455,14 @@ void set_units_in_combat(struct unit *pa
 {
   punit_attacking = pattacker;
   punit_defending = pdefender;
+
+  if (punit_attacking == punit_focus || punit_defending == punit_focus) {
+    /* If one of the units is the focus unit, make sure hidden-focus is
+     * disabled.  We don't just do this as a check later because then
+     * with a blinking unit it would just disappear again right after the
+     * battle. */
+    set_focus_unit_hidden_state(FALSE);
+  }
 }
 
 /**************************************************************************

[Prev in Thread] Current Thread [Next in Thread]