summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2021-05-20 22:44:22 +0200
committerAki <please@ignore.pl>2021-05-20 22:44:22 +0200
commit0408fade8b5650c3ce61e733d13a1fdd6dabb66b (patch)
tree128b7d72463740350af73944d20b98bfc34fe0c1
parentcf649f18dc3097a332445ceefef9820f11fad0ad (diff)
downloadfield-0408fade8b5650c3ce61e733d13a1fdd6dabb66b.zip
field-0408fade8b5650c3ce61e733d13a1fdd6dabb66b.tar.gz
field-0408fade8b5650c3ce61e733d13a1fdd6dabb66b.tar.bz2
Readded and extended battle naming
-rw-r--r--storage.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/storage.go b/storage.go
index e57e0f2..67c71f1 100644
--- a/storage.go
+++ b/storage.go
@@ -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