diff options
| -rw-r--r-- | pacman-c++/server.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/pacman-c++/server.cpp b/pacman-c++/server.cpp index 4219a43..07e4c72 100644 --- a/pacman-c++/server.cpp +++ b/pacman-c++/server.cpp | |||
| @@ -354,10 +354,6 @@ void Server::sendUpdate(Transmission::map_t map, bool firstPacket) | |||
| 354 | 354 | ||
| 355 | void Server::botCalculate(Actor *actor) | 355 | void Server::botCalculate(Actor *actor) |
| 356 | { | 356 | { |
| 357 | /* move as long as possible in one direction */ | ||
| 358 | //if (m_actorMovements[actor->color()] != Actor::None) | ||
| 359 | // return; | ||
| 360 | |||
| 361 | QPoint actorpos = CoordToMapPosition(actor->pos().toPoint()); | 357 | QPoint actorpos = CoordToMapPosition(actor->pos().toPoint()); |
| 362 | 358 | ||
| 363 | /* first make list of possible directions based on current actor position */ | 359 | /* first make list of possible directions based on current actor position */ |
| @@ -396,7 +392,7 @@ void Server::botCalculate(Actor *actor) | |||
| 396 | if (directions.empty()) | 392 | if (directions.empty()) |
| 397 | return; | 393 | return; |
| 398 | 394 | ||
| 399 | /* determine if other actors are in range to afraid/hunt*/ | 395 | /* determine if other actors are in range to be afraid/to hunt */ |
| 400 | int mindistance = Constants::AI::player_minimum_distance; | 396 | int mindistance = Constants::AI::player_minimum_distance; |
| 401 | QList<QPoint> pos_afraid; | 397 | QList<QPoint> pos_afraid; |
| 402 | QList<QPoint> pos_hunt; | 398 | QList<QPoint> pos_hunt; |
| @@ -439,7 +435,6 @@ void Server::botCalculate(Actor *actor) | |||
| 439 | foreach(QPoint otherpos, pos_hunt) | 435 | foreach(QPoint otherpos, pos_hunt) |
| 440 | { | 436 | { |
| 441 | int olddistance = (actorpos - otherpos).manhattanLength(); | 437 | int olddistance = (actorpos - otherpos).manhattanLength(); |
| 442 | |||
| 443 | int newdistance = (newpos - otherpos).manhattanLength(); | 438 | int newdistance = (newpos - otherpos).manhattanLength(); |
| 444 | if (newdistance <= olddistance) | 439 | if (newdistance <= olddistance) |
| 445 | i.setValue(i.value() += Constants::AI::weight_hunt); | 440 | i.setValue(i.value() += Constants::AI::weight_hunt); |
