Skip to content

Commit

Permalink
only reenable spawns when the party has moved away some
Browse files Browse the repository at this point in the history
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
fizzet committed May 5, 2013
1 parent dd81132 commit 6448a16
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gemrb/core/Map.cpp
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 6448a16

Please sign in to comment.