diff options
| author | AShifter <[email protected]> | 2017-06-05 10:01:16 -0600 |
|---|---|---|
| committer | AShifter <[email protected]> | 2017-06-05 10:01:16 -0600 |
| commit | a152c2c463d7ab45394b4fec84ae46be5105d3fe (patch) | |
| tree | 7d437ad6e694c13ec6e4e34390698a3f9d6d6edf /ShiftOS.WinForms/Applications | |
| parent | 61c906e596145bbedd60725c6dcee68c34a27907 (diff) | |
| download | shiftos_thereturn-a152c2c463d7ab45394b4fec84ae46be5105d3fe.tar.gz shiftos_thereturn-a152c2c463d7ab45394b4fec84ae46be5105d3fe.tar.bz2 shiftos_thereturn-a152c2c463d7ab45394b4fec84ae46be5105d3fe.zip | |
Fixed ShiftLotto (again)
Recently, Codepoints have been changed to ULong64. While SuperDoggo (on
discord) was playing ShiftLotto, he tried to bet 100cp with only 80cp.
The check to make sure you don't overbet failed because ShiftLotto
subtracts codepoints*difficulty - currentCodepoints. If this value is
negitive, it should give you an error. But, due to the transition to
ulong,, this does not work and the check passes, removing (or adding if
you're lucky) codepoints, crashing the game. I fixed this by simply
changing thechecking statment from subtraction to a Less Than check (<).
WOW I TYPED ALOT OF STUFF
Diffstat (limited to 'ShiftOS.WinForms/Applications')
| -rw-r--r-- | ShiftOS.WinForms/Applications/ShiftLotto.cs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/ShiftOS.WinForms/Applications/ShiftLotto.cs b/ShiftOS.WinForms/Applications/ShiftLotto.cs index 3f940c7..03d051b 100644 --- a/ShiftOS.WinForms/Applications/ShiftLotto.cs +++ b/ShiftOS.WinForms/Applications/ShiftLotto.cs @@ -50,11 +50,11 @@ namespace ShiftOS.WinForms.Applications { timer1.Start(); } - + public void OnSkinLoad() { - + } public bool OnUnload() @@ -64,7 +64,7 @@ namespace ShiftOS.WinForms.Applications public void OnUpgrade() { - + } // The Dynamic Display @@ -82,13 +82,13 @@ namespace ShiftOS.WinForms.Applications int codePoints = Convert.ToInt32(Math.Round(cpUpDown.Value, 0)); int difficulty = Convert.ToInt32(Math.Round(difUpDown.Value, 0)); - if (SaveSystem.CurrentSave.Codepoints <= 9) + if (SaveSystem.CurrentSave.Codepoints < 10) { Infobox.Show("Not enough Codepoints", "You do not have enough Codepoints to use ShiftLotto!"); } else { - if (SaveSystem.CurrentSave.Codepoints - (ulong)(codePoints * difficulty) <= 0) + if (SaveSystem.CurrentSave.Codepoints < (ulong)(codePoints * difficulty)) { Infobox.Show("Not enough Codepoints", "You do not have enough Codepoints to gamble this amount!"); } @@ -110,7 +110,7 @@ namespace ShiftOS.WinForms.Applications // If you win // Add Codepoints - SaveSystem.TransferCodepointsFrom("shiftlotto", jackpot); + SaveSystem.TransferCodepointsFrom("shiftlotto", (ulong)(codePoints * difficulty)); // Infobox Infobox.Show("YOU WON!", "Good Job! " + jackpot.ToString() + " CP has been added to your account. "); @@ -122,13 +122,13 @@ namespace ShiftOS.WinForms.Applications // Remove Codepoints SaveSystem.TransferCodepointsToVoid(jackpot); - + // Infobox Infobox.Show("YOU FAILED!", "Sorry! " + jackpot.ToString() + " CP has been removed from your account."); } - } - } + } + } } } }
\ No newline at end of file |
