From 1c42d07906964edddca80ac92a16c3c80edc6a9b Mon Sep 17 00:00:00 2001 From: onpon4 Date: Wed, 20 May 2015 10:39:30 -0400 Subject: [PATCH] Made the ammo cheat work on the laser and charge cannon. The laser never overheats with infinite ammo, and the charge cannon fires at full blast immediately. --- src/game.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/game.cpp b/src/game.cpp index 2fe61b4..e11d50d 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -1110,7 +1110,10 @@ static void game_doPlayer() if (player.ammo[1] < 100) { ship_fireBullet(&player, 1); - player.ammo[1] += 2; + + if (!engine.cheatAmmo) + player.ammo[1] += 2; + if (player.ammo[1] >= 100) { player.ammo[1] = 200; @@ -1128,6 +1131,11 @@ static void game_doPlayer() { if (!player_chargerFired) { + // With ammo cheat, cause the charge cannon to + // fire at full blast immediately. + if (engine.cheatAmmo) + player.ammo[1] = 200; + if (currentGame.difficulty == DIFFICULTY_ORIGINAL) { LIMIT_ADD(player.ammo[1], 1, 0, 200);