fix(teleport): enforce visitor warm-up
This commit is contained in:
@@ -95,7 +95,7 @@ final class BaseTeleportManager implements Listener {
|
||||
begin(
|
||||
visitor,
|
||||
owner.base().orElseThrow(),
|
||||
policy.warmup(owner),
|
||||
policy.visitorWarmup(owner),
|
||||
owner.playerId(),
|
||||
policy.cooldown(owner),
|
||||
"visit " + owner.latestName() + "'s base"
|
||||
|
||||
@@ -25,6 +25,13 @@ public final class TeleportPolicy {
|
||||
};
|
||||
}
|
||||
|
||||
public Duration visitorWarmup(PlayerState owner) {
|
||||
Duration warmup = warmup(owner);
|
||||
return warmup.compareTo(Duration.ofSeconds(1)) < 0
|
||||
? Duration.ofSeconds(1)
|
||||
: warmup;
|
||||
}
|
||||
|
||||
public Duration cooldown(PlayerState player) {
|
||||
return switch (player.cooldownLevel()) {
|
||||
case 0 -> Duration.ofSeconds(settings.current().initialTeleportCooldownSeconds());
|
||||
|
||||
Reference in New Issue
Block a user