Fix pressing CC2 actions while moving

This commit is contained in:
Eevee (Evelyn Woods) 2020-12-15 21:14:38 -07:00
parent eec7ab2e1a
commit daa3581be0

View File

@ -318,7 +318,7 @@ export class Level {
this.cells = []; this.cells = [];
this.player = null; this.player = null;
this.previous_input = 0; this.p1_previous_still_input = 0;
this.actors = []; this.actors = [];
this.chips_remaining = this.stored_level.chips_required; this.chips_remaining = this.stored_level.chips_required;
this.bonus_points = 0; this.bonus_points = 0;
@ -684,7 +684,7 @@ export class Level {
// have four bowling balls and hold Q, you'll throw the first, wait a second or so, then // have four bowling balls and hold Q, you'll throw the first, wait a second or so, then
// release the rest rapid-fire. absurd // release the rest rapid-fire. absurd
if (actor === this.player) { if (actor === this.player) {
let new_input = p1_input & ~this.previous_input; let new_input = p1_input & ~this.p1_previous_still_input;
if (new_input & INPUT_BITS.cycle) { if (new_input & INPUT_BITS.cycle) {
this.cycle_inventory(this.player); this.cycle_inventory(this.player);
} }
@ -696,6 +696,7 @@ export class Level {
// checking this.player // checking this.player
swap_player1 = true; swap_player1 = true;
} }
this.p1_previous_still_input = p1_input;
} }
if (! actor.decision) if (! actor.decision)
@ -754,8 +755,6 @@ export class Level {
this.player = this.players[this.player_index]; this.player = this.players[this.player_index];
} }
this.previous_input = p1_input;
// Advance the clock // Advance the clock
// TODO i suspect cc2 does this at the beginning of the tic, but even if you've won? if you // TODO i suspect cc2 does this at the beginning of the tic, but even if you've won? if you
// step on a penalty + exit you win, but you see the clock flicker 1 for a single frame // step on a penalty + exit you win, but you see the clock flicker 1 for a single frame