fix for damage-all value="false" bug ( direct hit still hurt an ally unit, but splash doesn't )
This commit is contained in:
parent
96114d25e4
commit
3b02f9c9b7
|
@ -1,7 +1,7 @@
|
|||
// ==============================================================
|
||||
// This file is part of Glest (www.glest.org)
|
||||
//
|
||||
// Copyright (C) 2001-2008 Martiño Figueroa
|
||||
// Copyright (C) 2001-2008 Marti<EFBFBD>o Figueroa
|
||||
//
|
||||
// You can redistribute this code and/or modify it under
|
||||
// the terms of the GNU General Public License as published
|
||||
|
@ -637,7 +637,11 @@ void UnitUpdater::hit(Unit *attacker, const AttackSkillType* ast, const Vec2i &t
|
|||
while(pci.next()){
|
||||
Unit *attacked= map->getCell(pci.getPos())->getUnit(targetField);
|
||||
if(attacked!=NULL){
|
||||
damage(attacker, ast, attacked, pci.getPos().dist(attacker->getTargetPos()));
|
||||
if(ast->getSplashDamageAll()
|
||||
|| !attacker->isAlly(attacked)
|
||||
|| ( targetPos.x==pci.getPos().x && targetPos.y==pci.getPos().y )){
|
||||
damage(attacker, ast, attacked, pci.getPos().dist(attacker->getTargetPos()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue