package game import ( "thehouseoficarus/internal/net" ) func (g *Game) executeMap(sess *net.Session, args []string, rawInput string) { g.doMap(sess) } func (g *Game) doMap(sess *net.Session) { p := sess.Player mapWidth := p.OptionInt("map_width") mapHeight := p.OptionInt("map_height") if mapWidth < 5 { mapWidth = 5 } if mapHeight < 5 { mapHeight = 5 } lines := buildFullMap(g, p.RoomID, mapWidth, mapHeight, mapGlyphsForPlayer(p.OptionBool("unicode"))) mode := p.OptionString("map_padding") 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) } }