From 3b02f9c9b7d75bb081624c1d3e0070d1647a36f4 Mon Sep 17 00:00:00 2001 From: Titus Tscharntke Date: Wed, 24 Feb 2010 23:25:32 +0000 Subject: [PATCH] fix for damage-all value="false" bug ( direct hit still hurt an ally unit, but splash doesn't ) --- source/glest_game/world/unit_updater.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/glest_game/world/unit_updater.cpp b/source/glest_game/world/unit_updater.cpp index da82bc814..92dcc95d5 100644 --- a/source/glest_game/world/unit_updater.cpp +++ b/source/glest_game/world/unit_updater.cpp @@ -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�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())); + } } } }