diff options
author | Aki <please@ignore.pl> | 2021-05-20 22:44:22 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2021-05-20 22:44:22 +0200 |
commit | 0408fade8b5650c3ce61e733d13a1fdd6dabb66b (patch) | |
tree | 128b7d72463740350af73944d20b98bfc34fe0c1 | |
parent | cf649f18dc3097a332445ceefef9820f11fad0ad (diff) | |
download | field-0408fade8b5650c3ce61e733d13a1fdd6dabb66b.zip field-0408fade8b5650c3ce61e733d13a1fdd6dabb66b.tar.gz field-0408fade8b5650c3ce61e733d13a1fdd6dabb66b.tar.bz2 |
Readded and extended battle naming
-rw-r--r-- | storage.go | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -89,7 +89,6 @@ func (b *Battle) From(stub *BattleStub) error { } b.Ships[key] = Ship{Name: t.Name, Group: g.Name} } - b.Name = "Untitled Fight" for key := range b.Locations { s, err := GetSolarSystem(key) if err != nil { @@ -110,6 +109,11 @@ func (b *Battle) From(stub *BattleStub) error { Constellation: c.Name, Region: r.Name, } + if b.Name == "" { + b.Name = fmt.Sprintf("Fight in %s", s.Name) + } else { + b.Name = fmt.Sprintf("%s, %s", b.Name, s.Name) + } } // TODO: Resolve Names return nil |