mail[Wesnoth-commits] r43416 - in /trunk: data/scenario-test.cfg src/actions.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by AI0867 on June 13, 2010 - 19:43:
Author: ai0867
Date: Sun Jun 13 19:43:29 2010
New Revision: 43416

URL: http://svn.gna.org/viewcvs/wesnoth?rev=43416&view=rev
Log:
Break off an attack if the combatants are no longer enemies

Modified:
    trunk/data/scenario-test.cfg
    trunk/src/actions.cpp

Modified: trunk/data/scenario-test.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/scenario-test.cfg?rev=43416&r1=43415&r2=43416&view=diff
==============================================================================
--- trunk/data/scenario-test.cfg (original)
+++ trunk/data/scenario-test.cfg Sun Jun 13 19:43:29 2010
@@ -178,6 +178,13 @@
         [/unit]
     [/side]
 
+    [event]
+        name=attack
+        [filter]
+            type="Elvish Shyde"
+        [/filter]
+        {MODIFY_UNIT (id=$second_unit.id) side 1}
+    [/event]
     [event]
         name=start
 #ifdef DEBUG_MODE

Modified: trunk/src/actions.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/actions.cpp?rev=43416&r1=43415&r2=43416&view=diff
==============================================================================
--- trunk/src/actions.cpp (original)
+++ trunk/src/actions.cpp Sun Jun 13 19:43:29 2010
@@ -1065,7 +1065,7 @@
        // The event could have killed either the attacker or
        // defender, so we have to make sure they still exist
        refresh_bc();
-       if(!a_.valid() || !d_.valid()) {
+       if(!a_.valid() || !d_.valid() || 
!(*resources::teams)[a_.get_unit().side() - 
1].is_enemy(d_.get_unit().side())) {
                if (update_display_){
                        recalculate_fog(attacker_side);
                        recalculate_fog(defender_side);




Related Messages


Powered by MHonArc, Updated Sun Jun 13 20:00:12 2010