1
0
forked from 0ad/0ad

do not let the captureStrength become infinite when capturing a damaged structure, fix #3973, patch by fatherbushido

This was SVN commit r18215.
This commit is contained in:
mimo 2016-05-21 16:44:20 +00:00
parent 4b5f8dfca6
commit 682086b7fb

View File

@ -583,7 +583,7 @@ Attack.prototype.PerformAttack = function(type, target)
let cmpHealth = Engine.QueryInterface(target, IID_Health);
if (!cmpHealth || cmpHealth.GetHitpoints() == 0)
return;
multiplier *= cmpHealth.GetMaxHitpoints() / cmpHealth.GetHitpoints();
multiplier *= cmpHealth.GetMaxHitpoints() / (0.1 * cmpHealth.GetMaxHitpoints() + 0.9 * cmpHealth.GetHitpoints());
let cmpOwnership = Engine.QueryInterface(this.entity, IID_Ownership);
if (!cmpOwnership || cmpOwnership.GetOwner() == -1)