Fixing platform inconsistency

It appears that the issue is a Windows problem, with Windows providing
macros for min and max that interfere with using the proper ones defined
in the algorithm header file.
This commit is contained in:
Mike Hoffert 2014-07-19 18:07:24 -06:00
parent cedb20646e
commit 191c353491
1 changed files with 4 additions and 4 deletions

View File

@ -2596,10 +2596,10 @@ void UnitUpdater::damage(Unit *attacker, const AttackSkillType* ast, Unit *attac
}
// Can't take more resources than the faction has, otherwise we end up in the negatives
else {
attacked->getFaction()->incResourceAmount(resource.getResourceType(), -min(resource.getLossPercentage() * factionTotalResource, factionTotalResource));
attacked->getFaction()->incResourceAmount(resource.getResourceType(), -min(resource.getLossValue(), factionTotalResource));
attacker->getFaction()->incResourceAmount(resource.getResourceType(), min(resource.getAmountPercentage() * factionTotalResource, factionTotalResource));
attacker->getFaction()->incResourceAmount(resource.getResourceType(), min(resource.getAmountValue(), factionTotalResource));
attacked->getFaction()->incResourceAmount(resource.getResourceType(), -(std::min)(static_cast<int>(resource.getLossPercentage() * factionTotalResource), factionTotalResource));
attacked->getFaction()->incResourceAmount(resource.getResourceType(), -(std::min)(resource.getLossValue(), factionTotalResource));
attacker->getFaction()->incResourceAmount(resource.getResourceType(), (std::min)(static_cast<int>(resource.getAmountPercentage() * factionTotalResource), factionTotalResource));
attacker->getFaction()->incResourceAmount(resource.getResourceType(), (std::min)(resource.getAmountValue(), factionTotalResource));
}
}
}