From ee4c612c2a1ec1b98cddea11bfd74fe9afbe85a6 Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Tue, 8 Jul 2025 23:37:08 +0200 Subject: Really decrease resource count --- gather_order.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'gather_order.go') diff --git a/gather_order.go b/gather_order.go index b306cd1..aee8b37 100644 --- a/gather_order.go +++ b/gather_order.go @@ -18,13 +18,12 @@ func (o *GatherOrder) Update(e *Entity, g *Game) { } gatherer := &e.ResourceGatherer.Value - source := gatherer.CurrentTarget.ResourceSource.Value if gatherer.CurrentVolume == gatherer.MaxCapacity { o.updateGathererFull(e, g, gatherer) return } if physics.Distance(e.Position.Value, gatherer.CurrentTarget.Position.Value) <= 100 { - o.updateGathering(gatherer, source) + o.updateGathering(gatherer, &gatherer.CurrentTarget.ResourceSource.Value) return } if !e.Move.Value.IsActive { @@ -32,7 +31,7 @@ func (o *GatherOrder) Update(e *Entity, g *Game) { } } -func (*GatherOrder) updateGathering(gatherer *ResourceGatherer, source ResourceSource) { +func (*GatherOrder) updateGathering(gatherer *ResourceGatherer, source *ResourceSource) { now := time.Now() if gatherer.CurrentVolume >= gatherer.MaxCapacity || gatherer.LastPickupTime.Add(200*time.Millisecond).After(now) { return -- cgit v1.3