From 7e52b6d8bb70beaf33a0db0da3d1e431a23c7466 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Fri, 24 Mar 2023 23:14:34 +0100 Subject: [PATCH] MultiServer: if there is a hint cost, don't make it 0 (#1581) --- MultiServer.py | 2 +- kvui.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/MultiServer.py b/MultiServer.py index 6fd06fec..acc68e16 100644 --- a/MultiServer.py +++ b/MultiServer.py @@ -597,7 +597,7 @@ class Context: def get_hint_cost(self, slot): if self.hint_cost: - return max(0, int(self.hint_cost * 0.01 * len(self.locations[slot]))) + return max(1, int(self.hint_cost * 0.01 * len(self.locations[slot]))) return 0 def recheck_hints(self, team: typing.Optional[int] = None, slot: typing.Optional[int] = None): diff --git a/kvui.py b/kvui.py index a1c6959d..effade0d 100644 --- a/kvui.py +++ b/kvui.py @@ -148,9 +148,11 @@ class ServerLabel(HovererableLabel): for permission_name, permission_data in ctx.permissions.items(): text += f"\n {permission_name}: {permission_data}" if ctx.hint_cost is not None and ctx.total_locations: + min_cost = int(ctx.server_version >= (0, 3, 9)) text += f"\nA new !hint costs {ctx.hint_cost}% of checks made. " \ - f"For you this means every {max(0, int(ctx.hint_cost * 0.01 * ctx.total_locations))} " \ - "location checks." + f"For you this means every " \ + f"{max(min_cost, int(ctx.hint_cost * 0.01 * ctx.total_locations))}" \ + f" location checks." elif ctx.hint_cost == 0: text += "\n!hint is free to use."