aboutsummaryrefslogtreecommitdiff
path: root/internal/game/action_farm.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/game/action_farm.go')
-rw-r--r--internal/game/action_farm.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/internal/game/action_farm.go b/internal/game/action_farm.go
index 87ea6b7..d8c7e00 100644
--- a/internal/game/action_farm.go
+++ b/internal/game/action_farm.go
@@ -502,7 +502,7 @@ func (g *Game) farmObjSuffix(p *player.Player, defID string, index int) string {
return ""
}
-func (g *Game) showFarmPatches(sess *net.Session, p *player.Player) {
+func (g *Game) showFarmPatches(sess *net.Session, p *player.Player) []string {
objInstances := g.World.AllObjInstances(p.RoomID)
hasFarmPatches := false
for _, obj := range objInstances {
@@ -512,7 +512,7 @@ func (g *Game) showFarmPatches(sess *net.Session, p *player.Player) {
}
}
if !hasFarmPatches {
- return
+ return nil
}
type farmDisplay struct {
@@ -609,13 +609,15 @@ func (g *Game) showFarmPatches(sess *net.Session, p *player.Player) {
}
if len(displays) == 0 {
- return
+ return nil
}
- sess.WriteLine("")
+ var lines []string
+ lines = append(lines, "")
for _, d := range displays {
- sess.WriteLine(fmt.Sprintf("A %s: %s.", d.name, d.line))
+ lines = append(lines, fmt.Sprintf("A %s: %s.", d.name, d.line))
}
+ return lines
}
func (g *Game) countPatchesByType(instances []world.ObjState, defID string) int {