Optimized calcStat method.

This commit is contained in:
MobiusDevelopment 2022-01-18 05:21:03 +00:00
parent b8f0b1f39c
commit 6aaf999da7
2 changed files with 4 additions and 2 deletions

View File

@ -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;
}
}
}

View File

@ -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;
}
}
}