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:
parent
9b1480453b
commit
3c677c18cb
@ -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 already in a session, but the player has failed to interact, and left the blacksmith, allow a new session
|
||||||
if (session != null) {
|
if (session != null) {
|
||||||
if (System.currentTimeMillis() > _sessionStart + 10 * 1000 &&
|
if (!session.isRunning() && (System.currentTimeMillis() > _sessionStart + 10 * 1000 ||
|
||||||
this.npc.getEntity().getLocation().distance(session.getPlayer().getLocation()) > 20) {
|
this.npc.getEntity().getLocation().distance(session.getPlayer().getLocation()) > 20)) {
|
||||||
session = null;
|
session = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user