Skip to content

Commit

Permalink
refactor: Update variable name in GameStepManager for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackRam-oss committed May 29, 2024
1 parent 263b251 commit 31d240a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/managers/StepManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ export default class GameStepManager {
*/
private static async runCurrentStep<T extends {}>(props: StepLabelPropsType<T>, choiseMade?: number): Promise<StepLabelResultType> {
if (GameStepManager.currentLabelId) {
let lasteStepsLength = GameStepManager.currentLabelStepIndex
if (lasteStepsLength === null) {
let lastStepsLength = GameStepManager.currentLabelStepIndex
if (lastStepsLength === null) {
console.error("[Pixi'VN] currentLabelStepIndex is null")
return
}
Expand All @@ -273,13 +273,13 @@ export default class GameStepManager {
return
}
let n = currentLabel.steps.length
if (n > lasteStepsLength) {
let nextStep = currentLabel.steps[lasteStepsLength]
let result = await nextStep(props)
GameStepManager.addStepHistory(nextStep, choiseMade)
if (n > lastStepsLength) {
let step = currentLabel.steps[lastStepsLength]
let result = await step(props)
GameStepManager.addStepHistory(step, choiseMade)
return result
}
else if (n === lasteStepsLength) {
else if (n === lastStepsLength) {
GameStepManager.closeCurrentLabel()
return await GameStepManager.runNextStep(props)
}
Expand Down

0 comments on commit 31d240a

Please sign in to comment.