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

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

[Wesnoth-cvs-commits] wesnoth/src actions.cpp


From: David White
Subject: [Wesnoth-cvs-commits] wesnoth/src actions.cpp
Date: Fri, 31 Dec 2004 09:48:45 -0500

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     David White <address@hidden>    04/12/31 14:36:54

Modified files:
        src            : actions.cpp 

Log message:
        made it so that invisible units aren't listed as sighted when they are 
in a unit's vision radius

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/actions.cpp.diff?tr1=1.177&tr2=1.178&r1=text&r2=text

Patches:
Index: wesnoth/src/actions.cpp
diff -u wesnoth/src/actions.cpp:1.177 wesnoth/src/actions.cpp:1.178
--- wesnoth/src/actions.cpp:1.177       Thu Dec 30 14:22:01 2004
+++ wesnoth/src/actions.cpp     Fri Dec 31 14:36:53 2004
@@ -1,4 +1,4 @@
-/* $Id: actions.cpp,v 1.177 2004/12/30 14:22:01 Sirp Exp $ */
+/* $Id: actions.cpp,v 1.178 2004/12/31 14:36:53 Sirp Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -1500,8 +1500,11 @@
 
        for(std::vector<gamemap::location>::const_iterator it =
            cleared_locations.begin(); it != cleared_locations.end(); ++it) {
-
-               if(units.count(*it)) {
+
+               const unit_map::const_iterator sighted = units.find(*it);
+               if(sighted != units.end() &&
+                 
(sighted->second.invisible(map.underlying_terrain(map[it->x][it->y]),status.get_time_of_day().lawful_bonus,*it,units,teams)
 == false
+                 || teams[team].is_enemy(sighted->second.side()) == false)) {
                        if(seen_units == NULL || known_units == NULL) {
                                static const std::string sighted("sighted");
                                game_events::fire(sighted,*it,loc);




reply via email to

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