From 6aaf999da7a868c3d999b440d22c5b2a3bd3d1b2 Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Tue, 18 Jan 2022 05:21:03 +0000 Subject: [PATCH] Optimized calcStat method. --- .../l2jmobius/gameserver/model/actor/stat/CreatureStat.java | 3 ++- .../l2jmobius/gameserver/model/actor/stat/CreatureStat.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/stat/CreatureStat.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/stat/CreatureStat.java index 5ced646460..727f3a435f 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/stat/CreatureStat.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/stat/CreatureStat.java @@ -59,7 +59,7 @@ public class CreatureStat */ public double calcStat(Stat stat, double init, Creature target, Skill skill) { - if (_creature == null) + if ((_creature == null) || (stat == null)) { return init; } @@ -106,6 +106,7 @@ public class CreatureStat case STAT_WIT: { env.value = 1; + break; } } } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/stat/CreatureStat.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/stat/CreatureStat.java index 5ced646460..727f3a435f 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/stat/CreatureStat.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/stat/CreatureStat.java @@ -59,7 +59,7 @@ public class CreatureStat */ public double calcStat(Stat stat, double init, Creature target, Skill skill) { - if (_creature == null) + if ((_creature == null) || (stat == null)) { return init; } @@ -106,6 +106,7 @@ public class CreatureStat case STAT_WIT: { env.value = 1; + break; } } }