From e4400c5f1e84c18d2126f2cb502ae10685977cbb Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Sat, 20 Jun 2026 03:20:01 -0400 Subject: refactor: combined all station crafting --- internal/world/ground.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'internal/world/ground.go') diff --git a/internal/world/ground.go b/internal/world/ground.go index 6c3ecf3..879cc71 100644 --- a/internal/world/ground.go +++ b/internal/world/ground.go @@ -63,7 +63,7 @@ func (w *World) GroundItems(roomID int) map[string]int { return out } -func (w *World) AddReservedGroundItem(roomID int, itemID string, qty int, owner string) { +func (w *World) AddReservedItem(roomID int, itemID string, qty int, owner string) { w.mu.Lock() defer w.mu.Unlock() e := &groundEntry{ @@ -87,7 +87,7 @@ func (w *World) AddGroundItem(roomID int, itemID string, qty int) { w.groundItems[roomID] = append(w.groundItems[roomID], e) } -func (w *World) RemoveReservedGroundItem(roomID int, itemID string, qty int, owner string) (int, bool) { +func (w *World) RemoveReservedItem(roomID int, itemID string, qty int, owner string) (int, bool) { w.mu.Lock() defer w.mu.Unlock() removed := 0 @@ -151,14 +151,14 @@ func (w *World) RemoveGroundItem(roomID int, itemID string, qty int) int { return removed } -func (w *World) tickGroundItemsLocked() { +func (w *World) tickGroundItems() { for _, entries := range w.groundItems { for _, e := range entries { if e.respawnTimer > 0 { e.respawnTimer-- if e.respawnTimer <= 0 { e.quantity = e.respawnQty - w.mergeNearbyItemsLocked(entries, e) + w.mergeNearbyItems(entries, e) } } if e.despawnTimer > 0 { @@ -177,7 +177,7 @@ func (w *World) tickGroundItemsLocked() { } } -func (w *World) mergeNearbyItemsLocked(entries []*groundEntry, target *groundEntry) { +func (w *World) mergeNearbyItems(entries []*groundEntry, target *groundEntry) { for _, other := range entries { if other != target && other.quantity > 0 && strings.EqualFold(other.itemID, target.itemID) && (other.reserveTimer <= 0 || other.reservedFor == "") && -- cgit v1.2.3