package game import ( "thirdcollapse/internal/net" "thirdcollapse/internal/player" ) func (g *Game) doMap(sess *net.Session) { p := sess.Player.(*player.Player) mapWidth := p.OptionInt("mapwidth") mapHeight := p.OptionInt("mapheight") if mapWidth < 5 { mapWidth = 5 } if mapHeight < 5 { mapHeight = 5 } lines := buildFullMap(g, p.RoomID, mapWidth, mapHeight) mode := p.OptionString("mappadding") if mode == "none" || mode == "x" { lines = stripBlankRows(lines) } if mode == "none" || mode == "y" { lines = leftTrimCommon(lines) } if len(lines) == 0 { sess.WriteLine("\nNo map data to display.") return } sess.WriteLine("") for _, line := range lines { sess.WriteLine(line) } }