URL:
  <http://gna.org/bugs/?12875>

                 Summary: [modify_side] doesn't clear team fog/shroud caches
                 Project: Battle for Wesnoth
            Submitted by: pmawhorter
            Submitted on: Tuesday 01/20/2009 at 03:33
                Category: Bug
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: WML
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 1.5.7 and trunk
        Operating System: Ubuntu Linux

    _______________________________________________________

Details:

In team.cpp on line 667 (inside of the change_team function), there is a loop
that clears the cached alliance states for all teams. However, nowhere in
change_team are the fog and shroud caches cleared (the variables ally_shroud_
and ally_fog_). This means that when WML is used to modify the team_name of a
side in order to ally that side with an existing side, shared vision is not
granted (as it should be according to the share_map and share_vision WML
variables of the teams involved). It's virtually impossible to work around
this in WML, as that would require doing something like switching the side of
each newly allied unit prior to every call to redraw made by the engine.

The fix for this bug should be simple: add the lines:

i->ally_shroud_.clear();
i->ally_fog_.clear();

below line 667 in team.cpp. This ought to result in regeneration of the
shroud/fog caches according to the new alliances (if any). I have tested this
by implementing the fix and recompiling:

With the extra two lines, a dynamically allied team shared vision as
appropriate, instead of not sharing vision. I also tested it using
share_maps=yes, share_vision=no for the dynamically allied team, and it
seemed to work (i.e. fog was not removed even after allying).



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Tuesday 01/20/2009 at 03:33  Name: team.cpp.patch  Size: 69B   By:
pmawhorter
2-line patch file for team.cpp
<http://gna.org/bugs/download.php?file_id=5197>

    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?12875>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs

Reply via email to