Skip to content

Commit

Permalink
Fix consumption of own resources (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlange-42 authored Mar 17, 2024
1 parent 5c2afbb commit ad2cbe8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions game/sys/do_consumption.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ func (s *DoConsumption) Update(world *ecs.World) {
cons.Countdown[i] -= int16(c)
if cons.Countdown[i] < 0 {
if prod.Resource == resource.Resource(i) && prod.Stock > 0 {
cons.Countdown[i] += int16(update.Countdown)
prod.Stock--
} else if stock.Res[i] > 0 {
cons.Countdown[i] += int16(update.Countdown)
Expand Down

0 comments on commit ad2cbe8

Please sign in to comment.