Summary: Optimize disabled autoattack case
                 Project: Freeciv
            Submitted by: cazfi
            Submitted on: Wed 20 Feb 2013 12:43:42 PM EET
                Category: general
                Priority: 5 - Normal
                  Status: Ready For Test
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 2.5.0



Check against disabled autoattack (default!) is made only in deep in the
iteration of autoattackers. Each unit is not selected to the list of
autoattackers when autoattack is disabled, leaving the constructed list empty.
All the autoattack stuff is executed even when autoattack is disabled, empty
list just makes sure no unit actually attacks.

Attached patch moves check for autoattack setting out of the loop, and no
autoattack code is executed when it's disabled.

Targeting to TRUNK only just to be extra safe - there's always a chance I
missed some side-effect that should happen even when autoattack disabled.


File Attachments:

Date: Wed 20 Feb 2013 12:43:42 PM EET  Name:
DisabledAutoattackOptimization.patch  Size: 1kB   By: cazfi



Reply to this item at:


  Message sent via/by Gna!

Freeciv-dev mailing list

Reply via email to