Makes sure to invalidate sessions properly
Sessions are invalidated if the player leaves the NPC or if 10 seconds pass, but only if the blacksmith isn't currently reforging.
This commit is contained in:
@ -133,8 +133,8 @@ public class BlacksmithTrait extends Trait {
|
||||
|
||||
//If already in a session, but the player has failed to interact, and left the blacksmith, allow a new session
|
||||
if (session != null) {
|
||||
if (System.currentTimeMillis() > _sessionStart + 10 * 1000 &&
|
||||
this.npc.getEntity().getLocation().distance(session.getPlayer().getLocation()) > 20) {
|
||||
if (!session.isRunning() && (System.currentTimeMillis() > _sessionStart + 10 * 1000 ||
|
||||
this.npc.getEntity().getLocation().distance(session.getPlayer().getLocation()) > 20)) {
|
||||
session = null;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user