diff options
| author | historia <[not public]> | 2026-06-25 00:44:47 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-25 00:44:47 -0400 |
| commit | 94a06fbbe682701ca4d4bd2a70cd74d8df29c932 (patch) | |
| tree | eb49fb1893e61092138164d419e863ee3fe0d1e2 /internal/game/game.go | |
| parent | 15b7e221b799ef107dec44ecdb294026dfd3d059 (diff) | |
| download | thehouseoficarus-94a06fbbe682701ca4d4bd2a70cd74d8df29c932.tar.gz | |
refactor: replaced map[string]any with typed structs for Data
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 { |
