URL:
<http://gna.org/patch/?1316>
Summary: Fixes for unit facing after undo/redo
Project: Battle for Wesnoth
Submitted by: dreamer_
Submitted on: Saturday 09/26/2009 at 17:44
Priority: 5 - Normal
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
This is follow-up for http://gna.org/patch/?1311
I found out that unit_display::move_unit function
is always accompanied by pattern:
if show_move
move_unit(blah)
else
invalidate path ends
so I modified move_unit function by adding new parameter "animate" (which
defaults to true), making usage of this function a little bit easier. Now
it's:
move_unit( ...blah..., show_move )
Thanks to that, units are now always facing direction based on their last
move - even if it was hidden (e.g. by shroud).
While looking through undo/redo implementation in menu_events.cpp
I discovered, that restoring unit facing is not implemented at all... so I
implemented it :) Redo movement was not affected, it works as expected.
This patch also contains small fixes to doxygen documentation, and
stylefixes, where spaces/tabs/line length were used in inconsistent manner.
These are things, that I am not sure about / I would like to address in next
patch:
1) Sometimes indefinite value for map_location::DIRECTION is required, but
there is none - usually in code NDIRECTIONS is used for that purpose (so I
used it also) but maybe new value would be better? if so, should it be
counted to NDIRECTIONS? (probably not)
2) Pushing to undo stack is done way too late - if it were done before move,
initializing code for undo action would be simpler and easier to use;
however, I am not aware of regressions that may result, so I left it as it
is.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Saturday 09/26/2009 at 17:44 Name: undo_facing.patch Size: 11kB By:
dreamer_
<http://gna.org/patch/download.php?file_id=6796>
_______________________________________________________
Reply to this item at:
<http://gna.org/patch/?1316>
_______________________________________________
Message sent via/by Gna!
http://gna.org/
_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs