Skip to content

Commit

Permalink
handle more negative-credit issues w/ SelectStyle
Browse files Browse the repository at this point in the history
It was previously possible to:
  • have premium turned off
	• enter 1 credit on ScreenTitleJoin
	• join PLAYER_1 on ScreenTitleJoin
	• get to ScreenSelectStyle
	• suddenly switch to using PLAYER_2's inputs
	• encounter a theme error when joining PLAYER_2 by trying to deduct credits that don't exist

This should be handled now.
  • Loading branch information
quietly-turning committed Nov 9, 2018
1 parent e388059 commit 9ad54c2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions BGAnimations/ScreenSelectStyle overlay/default.lua
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ local function input(event)
-- handle the case of joining an unjoined player in CoinMode_Pay
if GAMESTATE:GetCoinMode() == "CoinMode_Pay"
and GAMESTATE:GetPremium() ~= "Premium_2PlayersFor1Credit"
and GAMESTATE:EnoughCreditsToJoin()
and not GAMESTATE:IsHumanPlayer(event.PlayerNumber) then
if event.type == "InputEventType_FirstPress" and event.GameButton == "Start" then
-- join the player
Expand Down

0 comments on commit 9ad54c2

Please sign in to comment.