fix for damage-all value="false" bug ( direct hit still hurt an ally unit, but splash doesn't )

This commit is contained in:
Titus Tscharntke 2010-02-24 23:25:32 +00:00
parent 96114d25e4
commit 3b02f9c9b7
1 changed files with 6 additions and 2 deletions

View File

@ -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()));
}
}
}
}