Skip to content

Commit

Permalink
fixing bug that resets state on reveal finish
Browse files Browse the repository at this point in the history
  • Loading branch information
jjppof committed Jun 29, 2023
1 parent a602813 commit e326284
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions base/field_abilities/RevealFieldPsynergy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export class RevealFieldPsynergy extends FieldAbilities {

finish(force: boolean = false, stop_char: boolean = true, finish_callback?: () => void) {
this.controllable_char.on_reveal = false;
const previous_psynergy_state = this.controllable_char.casting_psynergy;
this.controllable_char.casting_psynergy = true;
this.toggle_reveal();
this.data.map.gray_filter.intensity = 0;
Expand All @@ -102,12 +103,12 @@ export class RevealFieldPsynergy extends FieldAbilities {
this.reveal_wave.destroy();
this.reveal_wave_filter.destroy();
this.waving_tween.stop();
if (stop_char && !this.controllable_char.jumping) {
if (stop_char && !this.controllable_char.jumping && !previous_psynergy_state) {
this.controllable_char.stop_char(true);
}
this.data.audio.play_se("psynergy/11");
const reset_states = () => {
this.controllable_char.casting_psynergy = false;
this.controllable_char.casting_psynergy = previous_psynergy_state;
if (finish_callback) {
finish_callback();
}
Expand Down

0 comments on commit e326284

Please sign in to comment.