hectorgimenez / koolo

Diablo II Resurrected bot written in Go
MIT License
67 stars 38 forks source link

Removing check if player is in town when taking tp causes kurast chest run to bug #224

Closed dmelia closed 2 months ago

dmelia commented 2 months ago

Details

the removal of the following code : if d.PlayerUnit.Area.IsTown() {return} during the refactor of tp_actions.go, makes the lower kurast chest run bug (the player tries to open a portal in town).

Version

dev

hectorgimenez commented 2 months ago

When is this happening? When going back to sell junk or what?

dmelia commented 2 months ago

yes, at the end of the run, when the bot has gone back to town

dmelia commented 2 months ago

This is sometimes happening with other runs too, it's not specifically the lower kurast chest run. I fixed it by reverting the code change to the ReturnTown() function in tp_actions.go full code : ` func (b Builder) ReturnTown() StepChainAction { return NewStepChain(func(d game.Data) (steps []step.Step) { if d.PlayerUnit.Area.IsTown() { return }

    return []step.Step{
        step.OpenPortal(),
        step.InteractObject(object.TownPortal, func(d game.Data) bool {
            return d.PlayerUnit.Area.IsTown()
        }),
    }
}, Resettable())

} `