From a3e0ae890b8caa5328f02cd47a92f8fcb81cc87b Mon Sep 17 00:00:00 2001 From: Titus Tscharntke Date: Fri, 24 Dec 2010 10:03:17 +0000 Subject: [PATCH] removed unnecessary alarm checks --- source/glest_game/world/unit_updater.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/glest_game/world/unit_updater.cpp b/source/glest_game/world/unit_updater.cpp index 42d96941..46cf8326 100644 --- a/source/glest_game/world/unit_updater.cpp +++ b/source/glest_game/world/unit_updater.cpp @@ -191,7 +191,10 @@ void UnitUpdater::updateUnitCommand(Unit *unit) { if(unit->isOperative() && (!(cc==ccStop || cc==ccAttack)) ) {//stop and attack already check for themselves Unit *sighted; - attackerOnSight(unit, &sighted); + if(unit->getTeam()==world->getThisTeamIndex()){ + // check only needed for alarm sound, so its enough to check teammates units + attackerOnSight(unit, &sighted); + } } unit->getCurrCommand()->getCommandType()->update(this, unit); }