Prevent multiple FeedableBeasts spawns from spamming feed.

This commit is contained in:
MobiusDevelopment 2022-01-27 06:09:32 +00:00
parent ddeb0b1f48
commit 310ea57339
5 changed files with 58 additions and 0 deletions

View File

@ -342,6 +342,17 @@ public class FeedableBeasts extends Quest
private void spawnNext(Npc npc, int growthLevel, Player player, int food)
{
if (npc.isScriptValue(1))
{
return;
}
npc.setScriptValue(1);
if (!npc.isSpawned())
{
return;
}
final int npcId = npc.getNpcId();
int nextNpcId = 0;

View File

@ -342,6 +342,17 @@ public class FeedableBeasts extends Quest
private void spawnNext(Npc npc, int growthLevel, Player player, int food)
{
if (npc.isScriptValue(1))
{
return;
}
npc.setScriptValue(1);
if (!npc.isSpawned())
{
return;
}
final int npcId = npc.getNpcId();
int nextNpcId = 0;

View File

@ -354,6 +354,17 @@ public class FeedableBeasts extends AbstractNpcAI
private void spawnNext(Npc npc, int growthLevel, Player player, int food)
{
if (npc.isScriptValue(1))
{
return;
}
npc.setScriptValue(1);
if (!npc.isSpawned())
{
return;
}
final int npcId = npc.getId();
int nextNpcId = 0;
@ -397,6 +408,7 @@ public class FeedableBeasts extends AbstractNpcAI
{
FEED_INFO.remove(npc.getObjectId());
}
// despawn the old mob
// TODO: same code? FIXED?
// @formatter:off

View File

@ -356,6 +356,17 @@ public class FeedableBeasts extends AbstractNpcAI
private void spawnNext(Npc npc, int growthLevel, Player player, int food)
{
if (npc.isScriptValue(1))
{
return;
}
npc.setScriptValue(1);
if (!npc.isSpawned())
{
return;
}
final int npcId = npc.getId();
int nextNpcId = 0;
@ -399,6 +410,7 @@ public class FeedableBeasts extends AbstractNpcAI
{
FEED_INFO.remove(npc.getObjectId());
}
// despawn the old mob
// TODO: same code? FIXED?
// @formatter:off

View File

@ -341,6 +341,17 @@ public class FeedableBeasts extends AbstractNpcAI
private void spawnNext(Npc npc, int growthLevel, Player player, int food)
{
if (npc.isScriptValue(1))
{
return;
}
npc.setScriptValue(1);
if (!npc.isSpawned())
{
return;
}
final int npcId = npc.getId();
int nextNpcId = 0;
@ -387,6 +398,7 @@ public class FeedableBeasts extends AbstractNpcAI
_feedInfo.remove(npc.getObjectId());
}
}
// despawn the old mob
// TODO: same code? FIXED?
// @formatter:off