Attempt to fix YeSagiraGuards onEvtThink issue.
This commit is contained in:
parent
850a989b49
commit
826ad542f1
@ -48,7 +48,7 @@ public final class YeSagiraGuards extends AbstractNpcAI
|
||||
{
|
||||
L2World.getInstance().forEachVisibleObjectInRange(npc, L2MonsterInstance.class, 1000, monster ->
|
||||
{
|
||||
if (monster.isScriptValue(0)) // not retail - but looks better
|
||||
if ((monster != null) && monster.isScriptValue(0)) // not retail - but looks better
|
||||
{
|
||||
monster.setScriptValue(1);
|
||||
npc.reduceCurrentHp(1, monster, null); // TODO: Find better way for attack
|
||||
|
@ -1079,8 +1079,13 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
@Override
|
||||
protected void onEvtThink()
|
||||
{
|
||||
// Check if the actor can't use skills and if a thinking action isn't already in progress
|
||||
if (_thinking || getActiveChar().isAllSkillsDisabled())
|
||||
// Check if the actor can't use skills
|
||||
if (getActiveChar().isAllSkillsDisabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
// Check if a thinking action isn't already in progress
|
||||
if (_thinking)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -1112,13 +1117,11 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, this + " - onEvtThink() failed", e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
// Stop thinking action
|
||||
_thinking = false;
|
||||
LOGGER.log(Level.WARNING, this + " - " + getIntention().toString() + " - onEvtThink() failed", e);
|
||||
}
|
||||
|
||||
// Finish thinking action
|
||||
_thinking = false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -48,7 +48,7 @@ public final class YeSagiraGuards extends AbstractNpcAI
|
||||
{
|
||||
L2World.getInstance().forEachVisibleObjectInRange(npc, L2MonsterInstance.class, 1000, monster ->
|
||||
{
|
||||
if (monster.isScriptValue(0)) // not retail - but looks better
|
||||
if ((monster != null) && monster.isScriptValue(0)) // not retail - but looks better
|
||||
{
|
||||
monster.setScriptValue(1);
|
||||
npc.reduceCurrentHp(1, monster, null); // TODO: Find better way for attack
|
||||
|
@ -1079,8 +1079,13 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
@Override
|
||||
protected void onEvtThink()
|
||||
{
|
||||
// Check if the actor can't use skills and if a thinking action isn't already in progress
|
||||
if (_thinking || getActiveChar().isAllSkillsDisabled())
|
||||
// Check if the actor can't use skills
|
||||
if (getActiveChar().isAllSkillsDisabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
// Check if a thinking action isn't already in progress
|
||||
if (_thinking)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -1112,13 +1117,11 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, this + " - onEvtThink() failed", e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
// Stop thinking action
|
||||
_thinking = false;
|
||||
LOGGER.log(Level.WARNING, this + " - " + getIntention().toString() + " - onEvtThink() failed", e);
|
||||
}
|
||||
|
||||
// Finish thinking action
|
||||
_thinking = false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -48,7 +48,7 @@ public final class YeSagiraGuards extends AbstractNpcAI
|
||||
{
|
||||
L2World.getInstance().forEachVisibleObjectInRange(npc, L2MonsterInstance.class, 1000, monster ->
|
||||
{
|
||||
if (monster.isScriptValue(0)) // not retail - but looks better
|
||||
if ((monster != null) && monster.isScriptValue(0)) // not retail - but looks better
|
||||
{
|
||||
monster.setScriptValue(1);
|
||||
npc.reduceCurrentHp(1, monster, null); // TODO: Find better way for attack
|
||||
|
@ -1079,8 +1079,13 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
@Override
|
||||
protected void onEvtThink()
|
||||
{
|
||||
// Check if the actor can't use skills and if a thinking action isn't already in progress
|
||||
if (_thinking || getActiveChar().isAllSkillsDisabled())
|
||||
// Check if the actor can't use skills
|
||||
if (getActiveChar().isAllSkillsDisabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
// Check if a thinking action isn't already in progress
|
||||
if (_thinking)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -1112,13 +1117,11 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, this + " - onEvtThink() failed", e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
// Stop thinking action
|
||||
_thinking = false;
|
||||
LOGGER.log(Level.WARNING, this + " - " + getIntention().toString() + " - onEvtThink() failed", e);
|
||||
}
|
||||
|
||||
// Finish thinking action
|
||||
_thinking = false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1079,8 +1079,13 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
@Override
|
||||
protected void onEvtThink()
|
||||
{
|
||||
// Check if the actor can't use skills and if a thinking action isn't already in progress
|
||||
if (_thinking || getActiveChar().isAllSkillsDisabled())
|
||||
// Check if the actor can't use skills
|
||||
if (getActiveChar().isAllSkillsDisabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
// Check if a thinking action isn't already in progress
|
||||
if (_thinking)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -1112,13 +1117,11 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, this + " - onEvtThink() failed", e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
// Stop thinking action
|
||||
_thinking = false;
|
||||
LOGGER.log(Level.WARNING, this + " - " + getIntention().toString() + " - onEvtThink() failed", e);
|
||||
}
|
||||
|
||||
// Finish thinking action
|
||||
_thinking = false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user