Addition of Creature isDisabled method.
This commit is contained in:
@ -951,7 +951,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
}
|
||||
try
|
||||
{
|
||||
if ((target == null) || (isAttackingDisabled() && !isSummon()) || !target.isTargetable())
|
||||
if ((target == null) || (isAttackDisabled() && !isSummon()) || !target.isTargetable())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -1928,11 +1928,19 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
}
|
||||
|
||||
/**
|
||||
* @return True if the Creature can't attack (stun, sleep, attackEndTime, fakeDeath, paralyze, attackMute).
|
||||
* @return True if the Creature can't attack (attackEndTime, attackMute, fake death, stun, sleep, paralyze).
|
||||
*/
|
||||
public boolean isAttackingDisabled()
|
||||
public boolean isAttackDisabled()
|
||||
{
|
||||
return hasBlockActions() || isAttackingNow() || isAlikeDead() || isPhysicalAttackMuted() || _AIdisabled;
|
||||
return isAttackingNow() || isDisabled();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return True if the Creature is disabled (attackMute, fake death, stun, sleep, paralyze).
|
||||
*/
|
||||
public boolean isDisabled()
|
||||
{
|
||||
return _AIdisabled || isAlikeDead() || isPhysicalAttackMuted() || hasBlockActions();
|
||||
}
|
||||
|
||||
public boolean isConfused()
|
||||
|
@ -2889,7 +2889,7 @@ public class PlayerInstance extends Playable
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_waitTypeSitting && !isAttackingDisabled() && !isControlBlocked() && !isImmobilized() && !isFishing())
|
||||
if (!_waitTypeSitting && !isAttackDisabled() && !isControlBlocked() && !isImmobilized() && !isFishing())
|
||||
{
|
||||
breakAttack();
|
||||
setSitting(true);
|
||||
|
@ -548,8 +548,8 @@ public class SkillCaster implements Runnable
|
||||
// Launch the magic skill in order to calculate its effects
|
||||
try
|
||||
{
|
||||
// Mobius: Disabled characters should not be able to finish bad skills.
|
||||
if (caster.isAttackingDisabled() && skill.isBad())
|
||||
// Disabled characters should not be able to finish bad skills.
|
||||
if (skill.isBad() && caster.isDisabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user