CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Philippe Plantier <[EMAIL PROTECTED]> 05/04/09 22:27:31
Modified files:
src : statistics.cpp
Log message:
Fixed [sequence] statistics generating empty WML keys -- which mean
that a
defender was attacked when it could not counter-attack.
Fixed this by adding an "s" before each sequence WML key. Software
using this
information should be updated accordingly.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/statistics.cpp.diff?tr1=1.15&tr2=1.16&r1=text&r2=text
Patches:
Index: wesnoth/src/statistics.cpp
diff -u wesnoth/src/statistics.cpp:1.15 wesnoth/src/statistics.cpp:1.16
--- wesnoth/src/statistics.cpp:1.15 Sun Mar 27 23:06:17 2005
+++ wesnoth/src/statistics.cpp Sat Apr 9 22:27:31 2005
@@ -2,6 +2,9 @@
#include "statistics.hpp"
#include "util.hpp"
+#include "log.hpp"
+
+#define ERR_NG lg::err(lg::engine)
namespace {
@@ -263,8 +266,11 @@
if(stats_disabled > 0)
return;
-
attacker_stats().attacks[bat_stats.chance_to_hit_defender][attacker_res]++;
-
defender_stats().defends[bat_stats.chance_to_hit_attacker][defender_res]++;
+ std::string attacker_key = "s" + attacker_res;
+ std::string defender_key = "s" + defender_res;
+
+
attacker_stats().attacks[bat_stats.chance_to_hit_defender][attacker_key]++;
+
defender_stats().defends[bat_stats.chance_to_hit_attacker][defender_key]++;
}
stats& attack_context::attacker_stats()