Skip to content

Commit 644f667

Browse files
committed
feat: add reroll cost < dollars check
1 parent 07a4a41 commit 644f667

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/lua/api.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,8 +705,15 @@ API.functions["shop"] = function(args)
705705
local times_rerolled_before = 0
706706
if G.GAME.round_scores and G.GAME.round_scores.times_rerolled then
707707
times_rerolled_before = G.GAME.round_scores.times_rerolled.amt or 0
708+
end
708709

709-
sendDebugMessage("times_rerolled_before: " .. tostring(times_rerolled_before))
710+
if dollars_before < reroll_cost then
711+
API.send_error_response(
712+
"Not enough dollars to reroll",
713+
ERROR_CODES.INVALID_ACTION,
714+
{ dollars = dollars_before, reroll_cost = reroll_cost }
715+
)
716+
return
710717
end
711718

712719
-- Perform the reroll (nil element because the function doesn't require it)

0 commit comments

Comments
 (0)