Skip to content

Commit

Permalink
Make 'command' trigger check both P1 and P2 commands (ikemenver > 0)
Browse files Browse the repository at this point in the history
When redirecting a command trigger to another player, command will first check if the other player is performing its own command with that name. If not, it'll check if it's performing the command from our own command list.
  • Loading branch information
Lazin3ss committed Feb 10, 2023
1 parent 0eeaa51 commit e002258
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/bytecode.go
Original file line number Diff line number Diff line change
Expand Up @@ -1157,11 +1157,14 @@ func (be BytecodeExp) run(c *Char) BytecodeValue {
sys.bcStack.PushB(false)
} else {
pno := c.playerNo
if oc.stCgi().ikemenver[0] > 0 || oc.stCgi().ikemenver[1] > 0 {
cmd, ok := c.cmd[pno].Names[sys.stringPool[sys.workingState.playerNo].List[*(*int32)(unsafe.Pointer(&be[i]))]]
ok = ok && c.command(pno, cmd)
if !ok && oc.stCgi().ikemenver[0] > 0 || oc.stCgi().ikemenver[1] > 0 && pno != sys.workingState.playerNo {
pno = sys.workingState.playerNo
cmd, ok = c.cmd[pno].Names[sys.stringPool[sys.workingState.playerNo].List[*(*int32)(unsafe.Pointer(&be[i]))]]
ok = ok && c.command(pno, cmd)
}
cmd, ok := c.cmd[pno].Names[sys.stringPool[sys.workingState.playerNo].List[*(*int32)(unsafe.Pointer(&be[i]))]]
sys.bcStack.PushB(ok && c.command(pno, cmd))
sys.bcStack.PushB(ok)
}
i += 4
case OC_ctrl:
Expand Down

0 comments on commit e002258

Please sign in to comment.