Author: boucman
Date: Wed Jul 30 19:22:15 2008
New Revision: 28270

URL: http://svn.gna.org/viewcvs/wesnoth?rev=28270&view=rev
Log:
apply patch 1090 by elvish pillager: fix a segfault due to WML removing some 
units

Modified:
    trunk/changelog
    trunk/data/core/about.cfg
    trunk/src/actions.cpp

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=28270&r1=28269&r2=28270&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Wed Jul 30 19:22:15 2008
@@ -38,6 +38,8 @@
    defender in a battle
    * Add some gcc-4.3.0 compilation fixes (patch #1083)
    * Fixed bug #12094: Event "last breath" cannot be triggered for attackers
+   * Fixed Wesnoth crashing after an attacker/defender_hits/misses event if
+   the WML kills one unit and replaces/unstores the other
 
 
 

Modified: trunk/data/core/about.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/core/about.cfg?rev=28270&r1=28269&r2=28270&view=diff
==============================================================================
--- trunk/data/core/about.cfg (original)
+++ trunk/data/core/about.cfg Wed Jul 30 19:22:15 2008
@@ -24,6 +24,11 @@
         name = "András Salamon (ott)"
         comment = "QA, bug fixing, subediting, game mechanics"
         wikiuser = "Ott"
+    [/entry]
+    [entry]
+        name = "Bartek Waresiak (Dragonking)"
+        comment = "unit balancing, Formula AI"
+        email = "dragonking_AT_o2.pl"
     [/entry]
     [entry]
         name = "Benoît Timbert (Noyga)"
@@ -566,11 +571,6 @@
 [about]
     title = _"Multiplayer Maps and Balancing"
     [entry]
-        name = "Bartek Waresiak (Dragonking)"
-        comment = "unit balancing"
-        email = "dragonking_AT_o2.pl"
-    [/entry]
-    [entry]
         name = "Jake Bailey (JB)"
         comment = "multiplayer maps"
     [/entry]

Modified: trunk/src/actions.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/actions.cpp?rev=28270&r1=28269&r2=28270&view=diff
==============================================================================
--- trunk/src/actions.cpp (original)
+++ trunk/src/actions.cpp Wed Jul 30 19:22:15 2008
@@ -801,8 +801,7 @@
 
        // The event could have killed either the attacker or
        // defender, so we have to make sure they still exist
-       a_ = units_.find(attacker_);
-       d_ = units_.find(defender_);
+       refresh_bc();
        /**
         * @todo FIXME: If the event removes this attack, we should stop 
attacking.
         * The previous code checked if 'attack_with' and 'defend_with'
@@ -895,6 +894,11 @@
        const events::command_disabler disable_commands;
 
        if(a_ == units_.end() || d_ == units_.end()) {
+               // Fix pointers to weapons
+               if (a_ != units_.end())
+                       
const_cast<battle_context::unit_stats*>(a_stats_)->weapon = 
&a_->second.attacks()[attack_with_];        
+               if (d_ != units_.end())
+                       
const_cast<battle_context::unit_stats*>(d_stats_)->weapon = 
&d_->second.attacks()[defend_with_];        
                return;
        }
 


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

Reply via email to