From e58d14f6e2efe7518bc693ced6e72bdda4c8f35e Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sat, 19 Jul 2025 19:28:52 -0400 Subject: fix broken permanent initializations --- go/game/equipment.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'go/game/equipment.go') diff --git a/go/game/equipment.go b/go/game/equipment.go index 32bb358c..ce21750f 100644 --- a/go/game/equipment.go +++ b/go/game/equipment.go @@ -1,16 +1,20 @@ package game +import ( + "log" +) + type Equipment struct { Artifact Durability int } -func newEquipmentFromPath(cardPath string, containing interface{}, owner *Player) *Equipment { +func newEquipmentFromPath(cardPath string, containing any, owner *Player) *Equipment { card := NewCard(cardPath) return newEquipment(card, containing, owner) } -func newEquipment(card *Card, containing interface{}, owner *Player) *Equipment { +func newEquipment(card *Card, containing any, owner *Player) *Equipment { e := &Equipment{ *NewArtifact(card, nil, owner), card.Values["durability"].(int), @@ -22,6 +26,8 @@ func newEquipment(card *Card, containing interface{}, owner *Player) *Equipment e.tile = containing case *Unit: addPermanentToPile(containing, e) + default: + log.Panicf("unhandled containing type: %t\n", containing) } } -- cgit v1.2.3