Fix avg cut not being reset

This commit is contained in:
Lee 2022-11-20 18:34:32 +00:00
parent d251f17da7
commit e38be5152a
No known key found for this signature in database
GPG Key ID: 6EA25896ECCB3121

@ -70,6 +70,14 @@ const handlers: any = {
length, length,
} = data.status.beatmap; } = data.status.beatmap;
state.reset(); state.reset();
cutData.saberA = {
count: [0, 0, 0],
totalScore: [0, 0, 0],
};
cutData.saberB = {
count: [0, 0, 0],
totalScore: [0, 0, 0],
};
state.setInSong(true); state.setInSong(true);
state.setCombo(data.status.performance.combo); state.setCombo(data.status.performance.combo);
useDataStore.setState({ loadedDuringSong: true }); useDataStore.setState({ loadedDuringSong: true });
@ -109,6 +117,14 @@ const handlers: any = {
} = data.status.beatmap; } = data.status.beatmap;
state.reset(); state.reset();
cutData.saberA = {
count: [0, 0, 0],
totalScore: [0, 0, 0],
};
cutData.saberB = {
count: [0, 0, 0],
totalScore: [0, 0, 0],
};
state.setInSong(true); state.setInSong(true);
state.updateMapData( state.updateMapData(
getMapHashFromLevelId(levelId), getMapHashFromLevelId(levelId),
@ -167,6 +183,14 @@ const handlers: any = {
finished: () => { finished: () => {
const state = useSongDataStore.getState(); const state = useSongDataStore.getState();
state.reset(); state.reset();
cutData.saberA = {
count: [0, 0, 0],
totalScore: [0, 0, 0],
};
cutData.saberB = {
count: [0, 0, 0],
totalScore: [0, 0, 0],
};
state.setInSong(false); state.setInSong(false);
updatePlayerData(); updatePlayerData();
useDataStore.setState({ loadedDuringSong: false }); useDataStore.setState({ loadedDuringSong: false });
@ -174,6 +198,14 @@ const handlers: any = {
menu: () => { menu: () => {
const state = useSongDataStore.getState(); const state = useSongDataStore.getState();
state.reset(); state.reset();
cutData.saberA = {
count: [0, 0, 0],
totalScore: [0, 0, 0],
};
cutData.saberB = {
count: [0, 0, 0],
totalScore: [0, 0, 0],
};
state.setInSong(false); state.setInSong(false);
updatePlayerData(); updatePlayerData();
useDataStore.setState({ loadedDuringSong: false }); useDataStore.setState({ loadedDuringSong: false });