diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-01-20 12:00:32 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-01-27 16:43:44 +0100 |
| commit | 260e52050562281a90b970c44e8816afb5f4dbaf (patch) | |
| tree | fa760f4a2b4db32dda5ad8d4d40574b27e302dbd /go/game/state.go | |
| parent | cbed4f79f1f7f90f600ad9d1d711f82c6e09e8e5 (diff) | |
| download | muhqs-game-260e52050562281a90b970c44e8816afb5f4dbaf.tar.gz muhqs-game-260e52050562281a90b970c44e8816afb5f4dbaf.zip | |
intermediate commit
* Add static analysis and improve Makefile
* Implement hints from static code analysis
Diffstat (limited to 'go/game/state.go')
| -rw-r--r-- | go/game/state.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/go/game/state.go b/go/game/state.go index 3d600093..5cab9458 100644 --- a/go/game/state.go +++ b/go/game/state.go @@ -58,11 +58,11 @@ func removePtr[P *Unit | *Artifact](collection []P, ptr P) []P { func (s *State) DestroyPermanent(p Permanent) { s.removePermanent(p) - switch p.(type) { + switch p := p.(type) { case *Unit: - s.Units = removePtr(s.Units, p.(*Unit)) + s.Units = removePtr(s.Units, p) case *Artifact: - s.Artifacts = removePtr(s.Artifacts, p.(*Artifact)) + s.Artifacts = removePtr(s.Artifacts, p) } } |
