diff options
Diffstat (limited to 'internal/game/game.go')
| -rw-r--r-- | internal/game/game.go | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/internal/game/game.go b/internal/game/game.go index a6b64cc..dfa5143 100644 --- a/internal/game/game.go +++ b/internal/game/game.go @@ -252,30 +252,6 @@ func (g *Game) ProcessQueuedCommands() { continue } - if p.ActionState != nil { - as, ok := p.ActionState.(*ActionState) - if !ok { - p.ActionState = nil - } else { - switch as.Type { - case ActionGathering, ActionCombating, ActionUsing, ActionTalking, - ActionBurning, ActionStoking, ActionSearching, ActionIdentifying, - ActionHacking, ActionHiding, ActionWorking, - ActionResting, ActionWalking, ActionProducing, - ActionStealing, ActionPlanting, ActionHarvesting, ActionRaking, ActionWatering, ActionCuring, - ActionTraversing: - default: - if as.Type != ActionMoving || p.MoveTicks <= 0 { - p.ActionState = nil - } - } - } - } - - if p.BackgroundAction == nil { - p.BackgroundActionState = nil - } - cmds := g.queue.DrainFree(p.Name) for _, qc := range cmds { g.cancelRest(p.Name) @@ -321,8 +297,8 @@ func (g *Game) ProcessQueuedCommands() { if len(parts) > 0 { g.executeCommand(qc.Session, parts[0], parts[1:], raw) } - as, hasAction := p.ActionState.(*ActionState) - isHiding := hasAction && as.Type == ActionHiding + ss, _ := g.safespot.Get(p.Name) + isHiding := ss.Active isBusy := p.Action != nil || len(p.WalkSequence) > 0 || combat.GetCombat(p.Name) != nil || p.MoveTicks > 0 || isHiding _, isResting := g.restTimers[p.Name] if !isResting && !isBusy && qc.Session.State == net.StateGame { |
