From 94a06fbbe682701ca4d4bd2a70cd74d8df29c932 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Thu, 25 Jun 2026 00:44:47 -0400 Subject: refactor: replaced map[string]any with typed structs for Data --- internal/game/game.go | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) (limited to 'internal/game/game.go') 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 { -- cgit v1.2.3