mirror of
https://github.com/glest/glest-source.git
synced 2025-08-21 07:31:21 +02:00
fix for damage-all value="false" bug ( direct hit still hurt an ally unit, but splash doesn't )
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
// ==============================================================
|
// ==============================================================
|
||||||
// This file is part of Glest (www.glest.org)
|
// This file is part of Glest (www.glest.org)
|
||||||
//
|
//
|
||||||
// Copyright (C) 2001-2008 Marti<74>o Figueroa
|
// Copyright (C) 2001-2008 Marti<74>o Figueroa
|
||||||
//
|
//
|
||||||
// You can redistribute this code and/or modify it under
|
// You can redistribute this code and/or modify it under
|
||||||
// the terms of the GNU General Public License as published
|
// the terms of the GNU General Public License as published
|
||||||
@@ -637,10 +637,14 @@ void UnitUpdater::hit(Unit *attacker, const AttackSkillType* ast, const Vec2i &t
|
|||||||
while(pci.next()){
|
while(pci.next()){
|
||||||
Unit *attacked= map->getCell(pci.getPos())->getUnit(targetField);
|
Unit *attacked= map->getCell(pci.getPos())->getUnit(targetField);
|
||||||
if(attacked!=NULL){
|
if(attacked!=NULL){
|
||||||
|
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()));
|
damage(attacker, ast, attacked, pci.getPos().dist(attacker->getTargetPos()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else{
|
else{
|
||||||
Unit *attacked= map->getCell(targetPos)->getUnit(targetField);
|
Unit *attacked= map->getCell(targetPos)->getUnit(targetField);
|
||||||
if(attacked!=NULL){
|
if(attacked!=NULL){
|
||||||
|
Reference in New Issue
Block a user