Skip to content

Commit

Permalink
Fix action goto bug
Browse files Browse the repository at this point in the history
  • Loading branch information
joemcbride committed May 25, 2024
1 parent caf3d48 commit 176fd6a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/src/Outlander.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1431,7 +1431,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 47;
CURRENT_PROJECT_VERSION = 48;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 9TZ225FMST;
Expand Down Expand Up @@ -1467,7 +1467,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 47;
CURRENT_PROJECT_VERSION = 48;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = 9TZ225FMST;
ENABLE_HARDENED_RUNTIME = YES;
Expand Down
11 changes: 10 additions & 1 deletion app/src/Outlander/Scripting/Script.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ protocol IWantStreamInfo {
func execute(_ script: Script, _ context: ScriptContext)
}

protocol IAction: IWantStreamInfo {
protocol IAction {
var id: String { get }
func stream(_ text: String, _ tokens: [StreamCommand], _ context: ScriptContext) -> CheckStreamResult
func execute(_ script: Script, _ context: ScriptContext)

var className: String { get set }
var enabled: Bool { get set }
var line: ScriptLine { get set }
Expand Down Expand Up @@ -306,6 +310,11 @@ class Script {
gosubStack.clear()
}

func matchesClear() {
matchStack.removeAll()
reactToStream.removeAll()
}

func queueNext() {
log.info("script queue next")
scriptQueue.queue(.next)
Expand Down
2 changes: 2 additions & 0 deletions app/src/Outlander/Scripting/ScriptOperations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class ActionOp: IAction {
continue
}
script.gosubClear()
script.matchesClear()
script.queueNext()
case .exit: script.cancel()
default: continue
Expand Down Expand Up @@ -139,6 +140,7 @@ class ActionEvalOp: IAction {
continue
}
script.gosubClear()
script.matchesClear()
script.queueNext()
case .exit: script.cancel()
default: continue
Expand Down

0 comments on commit 176fd6a

Please sign in to comment.