*Merge SD2.
*r983: Add additional checks for zoneInCombat-function. *r984: Remove two useless functions, cleanup some code. - The most part of the patch skipped. *r985: Clean up some code and prevent Spark from doing certain actions if in certain areas *r986: Remove most EventAI code - Skip this patch *r987: Correct and remove now obsolete documentation. - Skip: delete EventAI.txt --HG-- branch : trunk
This commit is contained in:
+16
-6
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user