[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Enigma-cvs] enigma/src actors.cc,1.45,1.46
From: |
Ralf Westram <address@hidden> |
Subject: |
[Enigma-cvs] enigma/src actors.cc,1.45,1.46 |
Date: |
Wed, 22 Oct 2003 00:06:38 +0000 |
Update of /cvsroot/enigma/enigma/src
In directory subversions:/tmp/cvs-serv14214
Modified Files:
actors.cc
Log Message:
- removed debugging output
- respawn works with flag
Index: actors.cc
===================================================================
RCS file: /cvsroot/enigma/enigma/src/actors.cc,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -d -r1.45 -r1.46
*** actors.cc 21 Oct 2003 19:46:46 -0000 1.45
--- actors.cc 22 Oct 2003 00:06:35 -0000 1.46
***************
*** 159,164 ****
Actor *a = *ai;
- a->warning(" found nearby actor");
-
if (a != &actor_to_set) {
double distance = length(p - a->get_pos());
--- 159,162 ----
***************
*** 166,171 ****
double wanted_gap = distance_wanted_to(*a);
- a->warning(" distance=%f gap_between=%f
wanted_gap=%f", distance, gap_between, wanted_gap);
-
if (gap_between < wanted_gap)
found_near_enemy = true;
--- 164,167 ----
***************
*** 192,198 ****
void examine(GridPos p) {
-
- fprintf(stderr, " examining position %i/%i\n", p.x, p.y);
-
if (checked.find(p) != checked.end()) return; // already examined
checked.insert(p); // never check again
--- 188,191 ----
***************
*** 209,213 ****
Stone *st = GetStone(p);
if (st) {
- st->warning("examine");
if (!search_through_stone(*st)) continue_search = false;
may_respawn = false;
--- 202,205 ----
***************
*** 218,223 ****
}
- fprintf(stderr, " examine result: may_respawn=%i
continue_search=%i\n", int(may_respawn), int(continue_search));
-
if (continue_search) blocked.insert(p);
if (may_respawn) candidates.insert(p);
--- 210,213 ----
***************
*** 247,255 ****
}
- fprintf(stderr, "Examining affected positions:\n");
for (ExaminedLocations::const_iterator ai = affected.begin(); ai
!= affected.end(); ++ai) {
examine(*ai);
}
- fprintf(stderr, "Examining affected positions done.\n");
if (candidates.size() != affected.size()) { // if any affected
location may not be used for respawning
--- 237,243 ----
***************
*** 263,271 ****
if (curr_blocked.empty()) {
- fprintf(stderr, "No blocked locations left\n");
break; // no chance to find a candidate
}
- fprintf(stderr, "Examining blocked positions:\n");
for (ExaminedLocations::const_iterator bl =
curr_blocked.begin(); bl != curr_blocked.end(); ++bl) {
examine(move(*bl, NORTH));
--- 251,257 ----
***************
*** 274,283 ****
examine(move(*bl, WEST));
}
- fprintf(stderr, "Examining blocked positions done.\n");
}
if (candidates.empty()) { // no better location -> take least
worse tested location
if (max_enemy_gap > 0.0) {
- fprintf(stderr, "Taking least worse position\n");
preferred_position = max_gap_pos;
}
--- 260,267 ----
***************
*** 289,293 ****
assert(c != candidates.end());
preferred_position = c->center();
- fprintf(stderr, "Randomly choose 1 of %i candidates\n",
candidates.size());
}
}
--- 273,276 ----
***************
*** 301,308 ****
Actor::find_respawnpos()
{
! if (!use_respawnpos) {
! FreeRespawnLocationFinder unblocked(startingpos, *this);
! startingpos = unblocked.get_position();
! }
}
--- 284,290 ----
Actor::find_respawnpos()
{
! V2& what_pos = use_respawnpos ? respawnpos : startingpos;
! FreeRespawnLocationFinder unblocked(what_pos, *this);
! what_pos = unblocked.get_position();
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Enigma-cvs] enigma/src actors.cc,1.45,1.46,
Ralf Westram <address@hidden> <=