Permalink
Browse files

only reenable spawns when the party has moved away some

If the spawn point is just out of sight it often respawns immediately,
attacking the party that is moving away from it from behind.
  • Loading branch information...
1 parent dd81132 commit 6448a16f6749ec931fd26d0b85cbd335b64968cd @fizzet fizzet committed May 4, 2013
Showing with 4 additions and 2 deletions.
  1. +4 −2 gemrb/core/Map.cpp
View
@@ -3109,8 +3109,10 @@ void Map::UpdateSpawns()
for (std::vector<Spawn *>::iterator it = spawns.begin() ; it != spawns.end(); ++it) {
Spawn *spawn = *it;
if ((spawn->Method & (SPF_NOSPAWN|SPF_WAIT)) == (SPF_NOSPAWN|SPF_WAIT)) {
- //only reactivate the spawn point if the party cannot currently see it
- if (spawn->NextSpawn < time && !IsVisible(spawn->Pos, false)) {
+ //only reactivate the spawn point if the party cannot currently see it;
+ //also make sure the party has moved away some
+ if (spawn->NextSpawn < time && !IsVisible(spawn->Pos, false) &&
+ !GetActorInRadius(spawn->Pos, GA_NO_DEAD|GA_NO_ENEMY|GA_NO_NEUTRAL, SPAWN_RANGE * 2)) {
spawn->Method &= ~SPF_WAIT;
}
}

0 comments on commit 6448a16

Please sign in to comment.