Skip to content

Commit

Permalink
Add 'standby' parameter to helper SCTRL
Browse files Browse the repository at this point in the history
Helpers inherit standby flag from root characters. By using this parameter, a character can force a specific standby for its helper, regardless of the standby value of the character itself.
  • Loading branch information
Lazin3ss committed Feb 11, 2023
1 parent e002258 commit ed89203
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/bytecode.go
Original file line number Diff line number Diff line change
Expand Up @@ -2944,6 +2944,7 @@ const (
helper_immortal
helper_kovelocity
helper_preserve
helper_standby
)

func (sc helper) Run(c *Char, _ []int32) bool {
Expand Down Expand Up @@ -3050,6 +3051,12 @@ func (sc helper) Run(c *Char, _ []int32) bool {
if exp[0].evalB(c) {
h.preserve = sys.round
}
case helper_standby:
if exp[0].evalB(c) {
h.setSCF(SCF_standby)
} else {
h.unsetSCF(SCF_standby)
}
}
return true
})
Expand Down
4 changes: 4 additions & 0 deletions src/compiler_functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,10 @@ func (c *Compiler) helper(is IniSection, sc *StateControllerBase, _ int8) (State
helper_preserve, VT_Bool, 1, false); err != nil {
return err
}
if err := c.paramValue(is, sc, "standby",
helper_standby, VT_Bool, 1, false); err != nil {
return err
}
return nil
})
return *ret, err
Expand Down

0 comments on commit ed89203

Please sign in to comment.