aboutsummaryrefslogtreecommitdiff
path: root/src/game/CreatureAI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/CreatureAI.cpp')
-rw-r--r--src/game/CreatureAI.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/game/CreatureAI.cpp b/src/game/CreatureAI.cpp
index e9970071f23..f61aca24405 100644
--- a/src/game/CreatureAI.cpp
+++ b/src/game/CreatureAI.cpp
@@ -73,14 +73,24 @@ void CreatureAI::DoZoneInCombat(Creature* creature)
return;
}
- Map::PlayerList const &PlayerList = map->GetPlayers();
- for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
+ Map::PlayerList const &PlList = map->GetPlayers();
+
+ if(PlList.isEmpty())
+ return;
+
+ for(Map::PlayerList::const_iterator i = PlList.begin(); i != PlList.end(); ++i)
{
- if (i->getSource()->isAlive())
+ if(Player* pPlayer = i->getSource())
{
- creature->SetInCombatWith(i->getSource());
- i->getSource()->SetInCombatWith(creature);
- creature->AddThreat(i->getSource(), 0.0f);
+ if(pPlayer->isGameMaster())
+ continue;
+
+ if(pPlayer->isAlive())
+ {
+ creature->SetInCombatWith(pPlayer);
+ pPlayer->SetInCombatWith(creature);
+ creature->AddThreat(pPlayer, 0.0f);
+ }
}
}
}