Skip to content

Commit 161bf0f

Browse files
committed
fix ticks for dendro and reduce condition
1 parent aea81ab commit 161bf0f

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

pkg/reactable/reactable.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ var elementsTick = []model.Element{
2020
model.Element_BurningFuel,
2121
}
2222

23+
var dendroElementsTick = []model.Element{
24+
model.Element_Grass,
25+
model.Element_Overdose,
26+
}
27+
2328
type Reactable struct {
2429
Durability [model.Element_COUNT]reactions.Durability
2530
DecayRate [model.Element_COUNT]reactions.Durability
@@ -260,7 +265,7 @@ func (r *Reactable) reduce(e attributes.Element, dur, factor reactions.Durabilit
260265
var reduced reactions.Durability
261266

262267
for i := model.Element_None; i < model.Element_COUNT; i++ {
263-
if attributes.ElementToModifier[e] == i {
268+
if attributes.ModifierToElement[i] != e {
264269
continue
265270
}
266271
if r.Durability[i] < ZeroDur {
@@ -330,7 +335,7 @@ func (r *Reactable) Tick() {
330335

331336
// if burning fuel is present, dendro and quicken uses burning fuel decay rate
332337
// otherwise it uses it's own
333-
for i := model.Element_Grass; i <= model.Element_Overdose; i++ {
338+
for _, i := range dendroElementsTick {
334339
if r.Durability[i] < ZeroDur {
335340
continue
336341
}

0 commit comments

Comments
 (0)