Skip to content

Commit 86c9ae5

Browse files
fdarosa2663profezzorn
authored andcommitted
Bug fix and adjustment for Special Abilities (#596)
1 parent ae459bd commit 86c9ae5

File tree

1 file changed

+24
-23
lines changed

1 file changed

+24
-23
lines changed

props/saber_fett263_buttons.h

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1958,6 +1958,7 @@ SaberFett263Buttons() : PropBase() {}
19581958
CheckEvent();
19591959
#endif
19601960
EditColor();
1961+
FreeWavplayerIfPossible();
19611962
if (SaberBase::IsOn()) {
19621963
DetectSwing();
19631964
#ifdef FETT263_SAVE_CHOREOGRAPHY
@@ -2146,6 +2147,13 @@ SaberFett263Buttons() : PropBase() {}
21462147
}
21472148
}
21482149

2150+
void FreeWavplayerIfPossible() {
2151+
if (!wav_player) return;
2152+
if (menu_) return;
2153+
if (wav_player->isPlaying()) return;
2154+
wav_player.Free();
2155+
}
2156+
21492157
void SelectPreset(int preset) {
21502158
#ifdef SAVE_PRESET
21512159
SaveState(preset);
@@ -4459,7 +4467,7 @@ SaberFett263Buttons() : PropBase() {}
44594467
}
44604468
menu_type_ = MENU_TOP;
44614469
menu_ = false;
4462-
twist_menu_ = M_PI / 2;
4470+
twist_menu_ = M_PI / 2.2;
44634471
wav_player.Free();
44644472
}
44654473

@@ -4640,7 +4648,6 @@ SaberFett263Buttons() : PropBase() {}
46404648
}
46414649

46424650
void DoIgnition() {
4643-
wav_player.Free();
46444651
#ifdef FETT263_DUAL_MODE_SOUND
46454652
SelectIgnitionSound();
46464653
#endif
@@ -5852,13 +5859,14 @@ SaberFett263Buttons() : PropBase() {}
58525859
return true;
58535860

58545861
case EVENTID(BUTTON_NONE, EVENT_TWIST_RIGHT, MODE_ON | BUTTON_POWER):
5855-
if (wav_player && wav_player->isPlaying()) {
5856-
current_menu_angle_ = fusor.angle2();
5857-
return false;
5858-
}
58595862
if (menu_) {
5860-
MenuDialIncrement(1);
5861-
return true;
5863+
if (wav_player && wav_player->isPlaying()) {
5864+
current_menu_angle_ = fusor.angle2();
5865+
return false;
5866+
} else {
5867+
MenuDialIncrement(1);
5868+
return true;
5869+
}
58625870
}
58635871
if (swinging_) {
58645872
return false;
@@ -5880,13 +5888,14 @@ SaberFett263Buttons() : PropBase() {}
58805888
return false;
58815889

58825890
case EVENTID(BUTTON_NONE, EVENT_TWIST_LEFT, MODE_ON | BUTTON_POWER):
5883-
if (wav_player && wav_player->isPlaying()) {
5884-
current_menu_angle_ = fusor.angle2();
5885-
return false;
5886-
}
58875891
if (menu_) {
5888-
MenuDialIncrement(-1);
5889-
return true;
5892+
if (wav_player && wav_player->isPlaying()) {
5893+
current_menu_angle_ = fusor.angle2();
5894+
return false;
5895+
} else {
5896+
MenuDialIncrement(-1);
5897+
return true;
5898+
}
58905899
}
58915900
if (swinging_) {
58925901
return false;
@@ -6099,7 +6108,6 @@ SaberFett263Buttons() : PropBase() {}
60996108
#ifdef FETT263_DUAL_MODE_SOUND
61006109
SelectIgnitionSound();
61016110
#endif
6102-
wav_player.Free();
61036111
if (SFX_preon) {
61046112
#ifdef FETT263_DUAL_MODE_SOUND
61056113
SelectPreonSound();
@@ -6121,7 +6129,6 @@ SaberFett263Buttons() : PropBase() {}
61216129
#ifdef FETT263_DUAL_MODE_SOUND
61226130
SelectIgnitionSound();
61236131
#endif
6124-
wav_player.Free();
61256132
FastOn();
61266133
#ifndef FETT263_SWING_ON_NO_BM
61276134
battle_mode_ = true;
@@ -6178,7 +6185,6 @@ SaberFett263Buttons() : PropBase() {}
61786185
#ifdef FETT263_DUAL_MODE_SOUND
61796186
SelectIgnitionSound();
61806187
#endif
6181-
wav_player.Free();
61826188
if (SFX_preon) {
61836189
#ifdef FETT263_DUAL_MODE_SOUND
61846190
SelectPreonSound();
@@ -6202,7 +6208,6 @@ SaberFett263Buttons() : PropBase() {}
62026208
#ifdef FETT263_DUAL_MODE_SOUND
62036209
SelectIgnitionSound();
62046210
#endif
6205-
wav_player.Free();
62066211
FastOn();
62076212
#ifndef FETT263_TWIST_ON_NO_BM
62086213
battle_mode_ = true;
@@ -6219,7 +6224,6 @@ SaberFett263Buttons() : PropBase() {}
62196224
#ifdef FETT263_DUAL_MODE_SOUND
62206225
SelectIgnitionSound();
62216226
#endif
6222-
wav_player.Free();
62236227
if (SFX_preon) {
62246228
#ifdef FETT263_DUAL_MODE_SOUND
62256229
SelectPreonSound();
@@ -6241,7 +6245,6 @@ SaberFett263Buttons() : PropBase() {}
62416245
#ifdef FETT263_DUAL_MODE_SOUND
62426246
SelectIgnitionSound();
62436247
#endif
6244-
wav_player.Free();
62456248
FastOn();
62466249
#ifndef FETT263_STAB_ON_NO_BM
62476250
battle_mode_ = true;
@@ -6258,7 +6261,6 @@ SaberFett263Buttons() : PropBase() {}
62586261
#ifdef FETT263_DUAL_MODE_SOUND
62596262
SelectIgnitionSound();
62606263
#endif
6261-
wav_player.Free();
62626264
if (SFX_preon) {
62636265
#ifdef FETT263_DUAL_MODE_SOUND
62646266
SelectPreonSound();
@@ -6280,7 +6282,6 @@ SaberFett263Buttons() : PropBase() {}
62806282
#ifdef FETT263_DUAL_MODE_SOUND
62816283
SelectIgnitionSound();
62826284
#endif
6283-
wav_player.Free();
62846285
FastOn();
62856286
#ifndef FETT263_THRUST_ON_NO_BM
62866287
battle_mode_ = true;
@@ -6460,7 +6461,7 @@ SaberFett263Buttons() : PropBase() {}
64606461
int sub_dial_; // Sub menu dial "tick"
64616462
int arg_dial_; // Argument Sub menu dial "tick"
64626463
int gesture_num_;
6463-
float twist_menu_ = M_PI / 2; // default Twist Right / Left sensitivity
6464+
float twist_menu_ = M_PI / 2.2; // default Twist Right / Left sensitivity
64646465
bool choice_ = false;
64656466
// Edit Mode selection confirmation
64666467
// for True/False control when deleting, disabling/enabling or copying

0 commit comments

Comments
 (0)