!hint now properly gives you prior collection info without needing enough to pay for another hint

This commit is contained in:
Fabian Dill 2020-07-13 03:21:28 +02:00
parent bdf95775ac
commit baba4b7c02
1 changed files with 22 additions and 25 deletions

View File

@ -825,8 +825,8 @@ class ClientMessageProcessor(CommonCommandProcessor):
import random import random
random.shuffle(not_found_hints) random.shuffle(not_found_hints)
if can_pay:
hints = [] hints = found_hints
while can_pay > 0: while can_pay > 0:
if not not_found_hints: if not not_found_hints:
break break
@ -839,20 +839,17 @@ class ClientMessageProcessor(CommonCommandProcessor):
self.ctx.hints[self.client.team, hint.finding_player].add(hint) self.ctx.hints[self.client.team, hint.finding_player].add(hint)
self.ctx.hints[self.client.team, hint.receiving_player].add(hint) self.ctx.hints[self.client.team, hint.receiving_player].add(hint)
else:
if not_found_hints: if not_found_hints:
if hints:
self.output( self.output(
"Could not pay for everything. Rerun the hint later with more points to get the remaining hints.") "Could not pay for everything. Rerun the hint later with more points to get the remaining hints.")
notify_hints(self.ctx, self.client.team, found_hints + hints)
self.ctx.save()
return True
else: else:
self.output(f"You can't afford the hint. " self.output(f"You can't afford the hint. "
f"You have {points_available} points and need at least " f"You have {points_available} points and need at least "
f"{self.ctx.hint_cost}") f"{self.ctx.hint_cost}")
return False notify_hints(self.ctx, self.client.team, hints)
self.ctx.save()
return True
else: else:
self.output("Nothing found. Item/Location may not exist.") self.output("Nothing found. Item/Location may not exist.")