only attack warnigs for local players teammates, not for every fight out there! ;-)

This commit is contained in:
Titus Tscharntke 2010-12-21 23:15:29 +00:00
parent 43eb95f1b4
commit df583854c3
1 changed files with 4 additions and 8 deletions

View File

@ -1785,7 +1785,10 @@ bool UnitUpdater::unitOnRange(const Unit *unit, int range, Unit **rangedPtr,
}
}
if(result && !(unit->isAlly(enemySeen)))
if( result &&
unit->getTeam()==world->getThisTeamIndex() && //must be in local players team.
!(unit->isAlly(enemySeen)))
{
// find nearest Attack and cleanup old dates
AttackWarningData *nearest=NULL;
@ -1837,13 +1840,6 @@ bool UnitUpdater::unitOnRange(const Unit *unit, int range, Unit **rangedPtr,
SoundRenderer::getInstance().playFx(CoreData::getInstance().getAttentionSound());
world->addAttackEffects(enemySeen);
}
// if(world->getFrameCount()-lastWarnFrameCount>100) //after 100 frames attack break we warn again
// {
// world->addAttackEffects(enemySeen);
// SoundRenderer::getInstance().playFx(CoreData::getInstance().getAttentionSound());
// }
// lastWarnFrameCount=world->getFrameCount();
}