1
0
mirror of synced 2025-01-19 16:38:41 +01:00

fix story bug

This commit is contained in:
ghkkk090 2022-08-18 19:38:36 +07:00
parent 78a38a0e55
commit f5e04ec49a

View File

@ -21,26 +21,11 @@ export async function saveStoryResult(body: wm.protobuf.SaveGameResultRequest, c
// storyResult is set
if (storyResult)
{
// Check if stClearDivCount is not 0
let stClearDivCount = undefined;
if(storyResult.stClearDivCount && storyResult.stClearDivCount !== 0)
{
stClearDivCount = storyResult.stClearDivCount
}
// Check if stClearCount is not 0
let stClearCount = undefined;
if(storyResult.stClearCount && storyResult.stClearCount !== 0)
{
stClearCount = storyResult.stClearCount
}
// Story update data
let data : any = {
stClearDivCount: stClearDivCount || undefined,
stClearDivCount: storyResult.stClearDivCount || undefined,
stPlayCount: storyResult.stPlayCount || undefined,
stClearCount: stClearCount || undefined,
stClearBits: storyResult.stClearBits || undefined,
stClearCount: storyResult.stClearCount || undefined,
stConsecutiveWins: storyResult.stConsecutiveWins || undefined,
tuningPoints: storyResult.tuningPoint || 0,
stCompleted100Episodes: storyResult.stCompleted_100Episodes || undefined,
@ -67,6 +52,13 @@ export async function saveStoryResult(body: wm.protobuf.SaveGameResultRequest, c
}
}
// Check if clearBits is not null, and not lose the story
if (storyResult.stClearBits !== null && storyResult.stClearBits !== undefined
&& data.stLoseBits === 0)
{
data.stClearBits = storyResult.stClearBits;
}
// Calling give meter reward function (BASE_PATH/src/util/meter_reward.ts)
let check_steps = await check_step.checkCurrentStep(body);