fixed some more possible overflow exceptions

This commit is contained in:
Ellpeck 2020-07-03 16:09:41 +02:00
parent 2aaba8f473
commit 25ae865600

View file

@ -168,7 +168,7 @@ namespace TouchyTickets {
ActionSound = new SoundEffectInfo(Assets.PlaceSound), ActionSound = new SoundEffectInfo(Assets.PlaceSound),
OnPressed = e2 => { OnPressed = e2 => {
GameImpl.Instance.Tickets -= price; GameImpl.Instance.Tickets -= price;
GameImpl.Instance.Platform.AddResourceEvent(true, "Tickets", (long) price, "Attraction", attraction.Key); GameImpl.Instance.Platform.AddResourceEvent(true, "Tickets", (float) price, "Attraction", attraction.Key);
map.Place(map.PlacingPosition, map.PlacingAttraction); map.Place(map.PlacingPosition, map.PlacingAttraction);
map.PlacingAttraction.Wobble(); map.PlacingAttraction.Wobble();
@ -249,7 +249,7 @@ namespace TouchyTickets {
if (GameImpl.Instance.Tickets < price) if (GameImpl.Instance.Tickets < price)
break; break;
GameImpl.Instance.Tickets -= price; GameImpl.Instance.Tickets -= price;
GameImpl.Instance.Platform.AddResourceEvent(true, "Tickets", (long)price, "Modifier", modifier.Name); GameImpl.Instance.Platform.AddResourceEvent(true, "Tickets", (float) price, "Modifier", modifier.Name);
attraction.ApplyModifier(map.PlacingModifier); attraction.ApplyModifier(map.PlacingModifier);
} }
attraction.Wobble(); attraction.Wobble();
@ -334,7 +334,7 @@ namespace TouchyTickets {
this.uiSystem.Remove(e2.Root.Name); this.uiSystem.Remove(e2.Root.Name);
var game = GameImpl.Instance; var game = GameImpl.Instance;
game.Platform.AddResourceEvent(true, "Tickets", (long) game.Tickets, "Restart", "Restart" + game.TimesRestarted); game.Platform.AddResourceEvent(true, "Tickets", (float) game.Tickets, "Restart", "Restart" + game.TimesRestarted);
game.Platform.AddResourceEvent(false, "Stars", game.GetBuyableStars(), "Restart", "Restart" + game.TimesRestarted); game.Platform.AddResourceEvent(false, "Stars", game.GetBuyableStars(), "Restart", "Restart" + game.TimesRestarted);
game.Stars += game.GetBuyableStars(); game.Stars += game.GetBuyableStars();