trying to fix problems with false attack alarms ...
This commit is contained in:
parent
5ea9cd092a
commit
39eefa1e67
|
@ -1764,16 +1764,19 @@ bool UnitUpdater::unitOnRange(const Unit *unit, int range, Unit **rangedPtr,
|
||||||
}
|
}
|
||||||
|
|
||||||
//any enemy
|
//any enemy
|
||||||
if(!result && (enemies.size() > 0)) {
|
for(int i = 0; i< enemies.size(); ++i) {
|
||||||
*rangedPtr= enemies.front();
|
if(enemies[i]->isAlive() == true ) {
|
||||||
enemySeen=*rangedPtr;
|
*rangedPtr= enemies[i];
|
||||||
return true;
|
enemySeen=enemies[i];
|
||||||
|
result=true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(result)
|
if(result)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(world->getFrameCount()-lastWarnFrameCount>80) //after 100 frames attack break we warn again
|
if(world->getFrameCount()-lastWarnFrameCount>10) //after 100 frames attack break we warn again
|
||||||
{
|
{
|
||||||
world->addAttackEffects(enemySeen);
|
world->addAttackEffects(enemySeen);
|
||||||
SoundRenderer::getInstance().playFx(CoreData::getInstance().getAttentionSound());
|
SoundRenderer::getInstance().playFx(CoreData::getInstance().getAttentionSound());
|
||||||
|
|
Loading…
Reference in New Issue
Block a user