wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth src/ai.cpp src/unit.hpp src/unit.cpp ./...


From: ott
Subject: [Wesnoth-cvs-commits] wesnoth src/ai.cpp src/unit.hpp src/unit.cpp ./...
Date: Thu, 11 Aug 2005 10:42:37 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     ott <address@hidden>    05/08/11 14:42:36

Modified files:
        src            : ai.cpp unit.hpp unit.cpp 
        .              : changelog 

Log message:
        fix AI not getting rest-healing, leading to replay OOS

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/ai.cpp.diff?tr1=1.155&tr2=1.156&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/unit.hpp.diff?tr1=1.73&tr2=1.74&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/unit.cpp.diff?tr1=1.158&tr2=1.159&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/changelog.diff?tr1=1.839&tr2=1.840&r1=text&r2=text

Patches:
Index: wesnoth/changelog
diff -u wesnoth/changelog:1.839 wesnoth/changelog:1.840
--- wesnoth/changelog:1.839     Wed Aug 10 21:28:21 2005
+++ wesnoth/changelog   Thu Aug 11 14:42:36 2005
@@ -6,6 +6,8 @@
  * campaigns
    * Eastern Invasion: further revisions for Weldyn Under Attack
  * fixed fonts sometimes not being found
+ * fixed campaign dialog with no campaigns trying forever to download (#14078)
+ * fixed AI units not getting rest-healing, causing replay errors
  * various bug fixes and code cleanups
 
 Version 0.9.5:
Index: wesnoth/src/ai.cpp
diff -u wesnoth/src/ai.cpp:1.155 wesnoth/src/ai.cpp:1.156
--- wesnoth/src/ai.cpp:1.155    Sat Jul  2 21:37:18 2005
+++ wesnoth/src/ai.cpp  Thu Aug 11 14:42:36 2005
@@ -1,4 +1,4 @@
-/* $Id: ai.cpp,v 1.155 2005/07/02 21:37:18 ott Exp $ */
+/* $Id: ai.cpp,v 1.156 2005/08/11 14:42:36 ott Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -28,6 +28,7 @@
 #include "preferences.hpp"
 #include "replay.hpp"
 #include "statistics.hpp"
+#include "unit.hpp"
 #include "unit_display.hpp"
 #include "util.hpp"
 #include "wassert.hpp"
@@ -375,7 +376,10 @@
        const location loc = move_unit_partial(from,to,possible_moves);
        const unit_map::iterator u = info_.units.find(loc);
        if(u != info_.units.end()) {
-               u->second.set_movement(0);
+               if (from == to)
+                       u->second.set_movement(unit::NOT_MOVED);
+               else
+                       u->second.set_movement(0);
        }
 
        return loc;
Index: wesnoth/src/unit.cpp
diff -u wesnoth/src/unit.cpp:1.158 wesnoth/src/unit.cpp:1.159
--- wesnoth/src/unit.cpp:1.158  Mon Aug  1 15:18:37 2005
+++ wesnoth/src/unit.cpp        Thu Aug 11 14:42:36 2005
@@ -1,4 +1,4 @@
-/* $Id: unit.cpp,v 1.158 2005/08/01 15:18:37 ott Exp $ */
+/* $Id: unit.cpp,v 1.159 2005/08/11 14:42:36 ott Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -259,7 +259,7 @@
 
 bool unit::can_attack() const
 {
-       return moves_ != -1;
+       return moves_ != ATTACKED;
 }
 
 void unit::set_movement(int moves)
Index: wesnoth/src/unit.hpp
diff -u wesnoth/src/unit.hpp:1.73 wesnoth/src/unit.hpp:1.74
--- wesnoth/src/unit.hpp:1.73   Mon Aug  1 15:18:37 2005
+++ wesnoth/src/unit.hpp        Thu Aug 11 14:42:36 2005
@@ -1,4 +1,4 @@
-/* $Id: unit.hpp,v 1.73 2005/08/01 15:18:37 ott Exp $ */
+/* $Id: unit.hpp,v 1.74 2005/08/11 14:42:36 ott Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -163,6 +163,10 @@
        bool move_interrupted() const;
        const gamemap::location& get_interrupted_move() const;
        void set_interrupted_move(const gamemap::location& interrupted_move);
+       //is set to the number of moves left, ATTACKED if attacked,
+       // MOVED if moved and then pressed "end turn"
+       // NOT_MOVED if not moved and pressed "end turn"
+       enum MOVES { ATTACKED=-1, MOVED=-2, NOT_MOVED=-3 };
 private:
        unit_race::GENDER generate_gender(const unit_type& type, bool 
use_genders);
        unit_race::GENDER gender_;
@@ -184,10 +188,6 @@
 
        int side_;
 
-       //is set to the number of moves left, ATTACKED if attacked,
-       // MOVED if moved and then pressed "end turn"
-       // NOT_MOVED if not moved and pressed "end turn"
-       enum MOVES { ATTACKED=-1, MOVED=-2, NOT_MOVED=-3 };
        int moves_;
        bool user_end_turn_;
        bool facingLeft_;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]