*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:
Anubisss
2009-05-27 21:30:03 +02:00
parent ba934b35d6
commit 4ce92ed6fa
4 changed files with 110 additions and 65 deletions
+16 -6
View File
@@ -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);
}
}
}
}