Merge pull request #9236 from Nightfirecat/fix-npc-respawn-timer-bug
npc indicators: Fix long respawn timer bug
This commit is contained in:
@@ -548,7 +548,16 @@ public class NpcIndicatorsPlugin extends Plugin
|
|||||||
|
|
||||||
if (mn.getDiedOnTick() != -1)
|
if (mn.getDiedOnTick() != -1)
|
||||||
{
|
{
|
||||||
mn.setRespawnTime(client.getTickCount() + 1 - mn.getDiedOnTick());
|
final int respawnTime = client.getTickCount() + 1 - mn.getDiedOnTick();
|
||||||
|
|
||||||
|
// By killing a monster and leaving the area before seeing it again, an erroneously lengthy
|
||||||
|
// respawn time can be recorded. Thus, if the respawn time is already set and is greater than
|
||||||
|
// the observed time, assume that the lower observed respawn time is correct.
|
||||||
|
if (mn.getRespawnTime() == -1 || respawnTime < mn.getRespawnTime())
|
||||||
|
{
|
||||||
|
mn.setRespawnTime(respawnTime);
|
||||||
|
}
|
||||||
|
|
||||||
mn.setDiedOnTick(-1);
|
mn.setDiedOnTick(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user