Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ toolchain go1.23.4

require (
github.com/golang/protobuf v1.5.4
github.com/google/go-cmp v0.6.0
github.com/google/go-cmp v0.7.0
github.com/google/uuid v1.6.0
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8
github.com/spf13/cobra v1.7.0
github.com/tailscale/hujson v0.0.0-20221223112325-20486734a56a
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394
golang.org/x/text v0.24.0
google.golang.org/protobuf v1.34.2
google.golang.org/protobuf v1.36.10
modernc.org/sqlite v1.37.0
)

Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e h1:ijClszYn+mADRFY17kjQEVQ1XRhq2/JR1M3sGqeJoxs=
github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
Expand Down Expand Up @@ -44,6 +46,8 @@ golang.org/x/tools v0.31.0 h1:0EedkvKDbh+qistFTd0Bcwe/YLh4vHwWEkiI0toFIBU=
golang.org/x/tools v0.31.0/go.mod h1:naFTU+Cev749tSJRXJlna0T3WxKvb1kWEx15xA4SdmQ=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=
google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
modernc.org/cc/v4 v4.25.2 h1:T2oH7sZdGvTaie0BRNFbIYsabzCxUQg8nLqCdQ2i0ic=
Expand Down
2 changes: 1 addition & 1 deletion sim/core/apl_values_spell.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ func (value *APLValueSpellInFlight) Type() proto.APLValueType {
return proto.APLValueType_ValueTypeBool
}
func (value *APLValueSpellInFlight) GetBool(sim *Simulation) bool {
return (value.spell.Unit.SpellsInFlight[value.spell] > 0)
return value.spell.Unit.SpellInFlight(value.spell)
}
func (value *APLValueSpellInFlight) String() string {
return fmt.Sprintf("SpellInFlight(%s)", value.spell.ActionID)
Expand Down
4 changes: 3 additions & 1 deletion sim/core/dot.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,9 @@ func (dot *Dot) DurationExtendSnapshot(sim *Simulation, extendBy time.Duration)
// Forces an instant tick. Does not reset the tick timer or aura duration,
// the tick is simply an extra tick.
func (dot *Dot) TickOnce(sim *Simulation) {
dot.onTick(sim, dot.Unit, dot)
if dot.onTick != nil {
dot.onTick(sim, dot.Unit, dot)
}
}

func (dot *Dot) periodicTick(sim *Simulation) {
Expand Down
9 changes: 9 additions & 0 deletions sim/core/unit.go
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,15 @@ func (unit *Unit) GetSpellsMatchingSchool(school SpellSchool) []*Spell {
return spells
}

func (unit *Unit) SpellInFlight(spell *Spell) bool {
Comment thread
espionn marked this conversation as resolved.
return unit.SpellsInFlight[spell] > 0
}

func (unit *Unit) SpellInFlightByID(spellID int32) bool {
spell := unit.GetSpell(ActionID{SpellID: spellID})
return unit.SpellInFlight(spell)
}

func (unit *Unit) GetUnit(ref *proto.UnitReference) *Unit {
return unit.Env.GetUnit(ref, unit)
}
Expand Down
Loading
Loading