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

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

[Wesnoth-cvs-commits] wesnoth/src pathfind.cpp unit.cpp unit_types.cp...


From: David White
Subject: [Wesnoth-cvs-commits] wesnoth/src pathfind.cpp unit.cpp unit_types.cp...
Date: Fri, 31 Dec 2004 20:27:44 -0500

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     David White <address@hidden>    05/01/01 00:44:52

Modified files:
        src            : pathfind.cpp unit.cpp unit_types.cpp unit.hpp 
                         unit_types.hpp 

Log message:
        took zocs away from level 0 units

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/pathfind.cpp.diff?tr1=1.51&tr2=1.52&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/unit.cpp.diff?tr1=1.110&tr2=1.111&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/unit_types.cpp.diff?tr1=1.74&tr2=1.75&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/unit.hpp.diff?tr1=1.57&tr2=1.58&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/unit_types.hpp.diff?tr1=1.54&tr2=1.55&r1=text&r2=text

Patches:
Index: wesnoth/src/pathfind.cpp
diff -u wesnoth/src/pathfind.cpp:1.51 wesnoth/src/pathfind.cpp:1.52
--- wesnoth/src/pathfind.cpp:1.51       Fri Dec 31 21:01:37 2004
+++ wesnoth/src/pathfind.cpp    Sat Jan  1 00:44:50 2005
@@ -1,4 +1,4 @@
-/* $Id: pathfind.cpp,v 1.51 2004/12/31 21:01:37 isaaccp Exp $ */
+/* $Id: pathfind.cpp,v 1.52 2005/01/01 00:44:50 Sirp Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -316,7 +316,7 @@
                                                
status.get_time_of_day().lawful_bonus,
                                                teams,current_team);
                if(it != units.end() && it->second.side() != side &&
-                  current_team.is_enemy(it->second.side()) && 
!it->second.stone()) {
+                  current_team.is_enemy(it->second.side()) && 
it->second.emits_zoc()) {
                        return true;
                }
        }
@@ -502,7 +502,7 @@
                                        adj[i],map_,
                                        
status_.get_time_of_day().lawful_bonus,teams_,team_);
 
-                       if(u != units_.end() && 
team_.is_enemy(u->second.side()) && !team_.fogged(adj[i].x,adj[i].y) && 
u->second.stone() == false) {
+                       if(u != units_.end() && 
team_.is_enemy(u->second.side()) && !team_.fogged(adj[i].x,adj[i].y) && 
u->second.emits_zoc()) {
                                return 100000.0;
                        }
                }
Index: wesnoth/src/unit.cpp
diff -u wesnoth/src/unit.cpp:1.110 wesnoth/src/unit.cpp:1.111
--- wesnoth/src/unit.cpp:1.110  Fri Dec 31 21:01:37 2004
+++ wesnoth/src/unit.cpp        Sat Jan  1 00:44:50 2005
@@ -1,4 +1,4 @@
-/* $Id: unit.cpp,v 1.110 2004/12/31 21:01:37 isaaccp Exp $ */
+/* $Id: unit.cpp,v 1.111 2005/01/01 00:44:50 Sirp Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -464,6 +464,11 @@
 bool unit::incapacitated() const
 {
        return stone();
+}
+
+bool unit::emits_zoc() const
+{
+       return type().has_zoc() && stone() == false;
 }
 
 bool unit::matches_filter(const config& cfg) const
Index: wesnoth/src/unit.hpp
diff -u wesnoth/src/unit.hpp:1.57 wesnoth/src/unit.hpp:1.58
--- wesnoth/src/unit.hpp:1.57   Thu Dec 30 02:52:37 2004
+++ wesnoth/src/unit.hpp        Sat Jan  1 00:44:50 2005
@@ -1,4 +1,4 @@
-/* $Id: unit.hpp,v 1.57 2004/12/30 02:52:37 Sirp Exp $ */
+/* $Id: unit.hpp,v 1.58 2005/01/01 00:44:50 Sirp Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -87,7 +87,9 @@
        bool poisoned() const;
        bool stone() const;
 
-       bool incapacitated() const;
+       bool incapacitated() const;
+
+       bool emits_zoc() const;
 
        bool matches_filter(const config& cfg) const;
 
Index: wesnoth/src/unit_types.cpp
diff -u wesnoth/src/unit_types.cpp:1.74 wesnoth/src/unit_types.cpp:1.75
--- wesnoth/src/unit_types.cpp:1.74     Fri Dec 31 21:01:37 2004
+++ wesnoth/src/unit_types.cpp  Sat Jan  1 00:44:50 2005
@@ -1,4 +1,4 @@
-/* $Id: unit_types.cpp,v 1.74 2004/12/31 21:01:37 isaaccp Exp $ */
+/* $Id: unit_types.cpp,v 1.75 2005/01/01 00:44:50 Sirp Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -959,6 +959,11 @@
 bool unit_type::can_advance() const
 {
        return can_advance_;
+}
+
+bool unit_type::has_zoc() const
+{
+       return level() > 0;
 }
 
 bool unit_type::has_ability(const std::string& ability) const
Index: wesnoth/src/unit_types.hpp
diff -u wesnoth/src/unit_types.hpp:1.54 wesnoth/src/unit_types.hpp:1.55
--- wesnoth/src/unit_types.hpp:1.54     Thu Dec 30 02:07:52 2004
+++ wesnoth/src/unit_types.hpp  Sat Jan  1 00:44:50 2005
@@ -1,4 +1,4 @@
-/* $Id: unit_types.hpp,v 1.54 2004/12/30 02:07:52 Sirp Exp $ */
+/* $Id: unit_types.hpp,v 1.55 2005/01/01 00:44:50 Sirp Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -229,7 +229,9 @@
        bool nightvision() const;
        bool steadfast() const;
        bool not_living() const;
-       bool can_advance() const;
+       bool can_advance() const;
+
+       bool has_zoc() const;
 
        bool has_ability(const std::string& ability) const;
 




reply via email to

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