From a02b19ac00f61d604a1895b1a4e1d39e6adcb28b Mon Sep 17 00:00:00 2001 From: Gene Pressinger Date: Wed, 26 May 2021 18:32:40 -0400 Subject: [PATCH 1/4] Fixed issue #349 --- .../services/gameplay/combat/command/CombatCommandHeal.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/projectswg/holocore/services/gameplay/combat/command/CombatCommandHeal.java b/src/main/java/com/projectswg/holocore/services/gameplay/combat/command/CombatCommandHeal.java index a47004955..422a20f00 100644 --- a/src/main/java/com/projectswg/holocore/services/gameplay/combat/command/CombatCommandHeal.java +++ b/src/main/java/com/projectswg/holocore/services/gameplay/combat/command/CombatCommandHeal.java @@ -64,6 +64,11 @@ enum CombatCommandHeal implements CombatCommandHitType { // Apply special line heal boost healAmount += CombatCommandCommon.getAddedDamageBoost(source, combatCommand); + if (healAmount <= 0) { + // Pointless to calculate who gets healed if we aren't healing any amount + return; + } + switch (combatCommand.getAttackType()) { case SINGLE_TARGET: { switch (combatCommand.getTargetType()) { From 4ce1a5fad1bbb2d8ba0c652a7bc46265e59e0d9c Mon Sep 17 00:00:00 2001 From: Gene Pressinger Date: Wed, 26 May 2021 18:53:52 -0400 Subject: [PATCH 2/4] This is actually the real fix (includes action too) --- .../combat/command/CombatCommandHeal.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/projectswg/holocore/services/gameplay/combat/command/CombatCommandHeal.java b/src/main/java/com/projectswg/holocore/services/gameplay/combat/command/CombatCommandHeal.java index 422a20f00..03f28c8a8 100644 --- a/src/main/java/com/projectswg/holocore/services/gameplay/combat/command/CombatCommandHeal.java +++ b/src/main/java/com/projectswg/holocore/services/gameplay/combat/command/CombatCommandHeal.java @@ -64,11 +64,6 @@ enum CombatCommandHeal implements CombatCommandHitType { // Apply special line heal boost healAmount += CombatCommandCommon.getAddedDamageBoost(source, combatCommand); - if (healAmount <= 0) { - // Pointless to calculate who gets healed if we aren't healing any amount - return; - } - switch (combatCommand.getAttackType()) { case SINGLE_TARGET: { switch (combatCommand.getTargetType()) { @@ -147,6 +142,11 @@ enum CombatCommandHeal implements CombatCommandHitType { switch (combatCommand.getHealAttrib()) { case HEALTH: { + if (healed.getHealth() == healed.getMaxHealth()) { + // Pointless to heal health if health is already full + return; + } + int currentHealth = healed.getHealth(); healed.modifyHealth(healAmount); difference = healed.getHealth() - currentHealth; @@ -156,6 +156,11 @@ enum CombatCommandHeal implements CombatCommandHitType { } case ACTION: { + if (healed.getAction() == healed.getMaxAction()) { + // Pointless to heal action if health is already full + return; + } + int currentAction = healed.getAction(); healed.modifyAction(healAmount); difference = healed.getAction() - currentAction; From 62c6f0f43e62cefc126d42405f33538d3e9c64d9 Mon Sep 17 00:00:00 2001 From: Gene Pressinger Date: Wed, 26 May 2021 18:59:35 -0400 Subject: [PATCH 3/4] Part of last commit --- .../combat/command/CombatCommandHeal.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/projectswg/holocore/services/gameplay/combat/command/CombatCommandHeal.java b/src/main/java/com/projectswg/holocore/services/gameplay/combat/command/CombatCommandHeal.java index 03f28c8a8..99fe0fe4f 100644 --- a/src/main/java/com/projectswg/holocore/services/gameplay/combat/command/CombatCommandHeal.java +++ b/src/main/java/com/projectswg/holocore/services/gameplay/combat/command/CombatCommandHeal.java @@ -142,12 +142,14 @@ enum CombatCommandHeal implements CombatCommandHitType { switch (combatCommand.getHealAttrib()) { case HEALTH: { - if (healed.getHealth() == healed.getMaxHealth()) { - // Pointless to heal health if health is already full + int currentHealth = healed.getHealth(); + int maxHealth = healed.getMaxHealth(); + + if (currentHealth == maxHealth) { + // Pointless to heal health if it's already full return; } - int currentHealth = healed.getHealth(); healed.modifyHealth(healAmount); difference = healed.getHealth() - currentHealth; attribName = "HEALTH"; @@ -156,12 +158,14 @@ enum CombatCommandHeal implements CombatCommandHitType { } case ACTION: { - if (healed.getAction() == healed.getMaxAction()) { - // Pointless to heal action if health is already full + int currentAction = healed.getAction(); + int maxAction = health.getMaxAction(); + + if (currentAction == maxAction) { + // Pointless to heal action if it's already full return; } - int currentAction = healed.getAction(); healed.modifyAction(healAmount); difference = healed.getAction() - currentAction; attribName = "ACTION"; From 3e02b05f4d85f6d94b5d6fd976a89cb517a1c220 Mon Sep 17 00:00:00 2001 From: Gene Pressinger Date: Wed, 26 May 2021 19:04:34 -0400 Subject: [PATCH 4/4] Typo fix --- .../services/gameplay/combat/command/CombatCommandHeal.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/projectswg/holocore/services/gameplay/combat/command/CombatCommandHeal.java b/src/main/java/com/projectswg/holocore/services/gameplay/combat/command/CombatCommandHeal.java index 99fe0fe4f..e04d57e50 100644 --- a/src/main/java/com/projectswg/holocore/services/gameplay/combat/command/CombatCommandHeal.java +++ b/src/main/java/com/projectswg/holocore/services/gameplay/combat/command/CombatCommandHeal.java @@ -159,7 +159,7 @@ enum CombatCommandHeal implements CombatCommandHitType { case ACTION: { int currentAction = healed.getAction(); - int maxAction = health.getMaxAction(); + int maxAction = healed.getMaxAction(); if (currentAction == maxAction) { // Pointless to heal action if it's already full