Skip to content

Commit

Permalink
Restore destroy buildings
Browse files Browse the repository at this point in the history
  • Loading branch information
jackiekircher committed Nov 6, 2011
1 parent 3f31aee commit 08f3a11
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion lib/vimcity/map.rb
Expand Up @@ -34,7 +34,6 @@ def add_building(building, y, x)
end

def destroy_building(y, x)
print @buildings_grid
return nil if @buildings_grid[y][x] == " "

if @buildings_grid[y][x].kind_of? Building
Expand Down
6 changes: 3 additions & 3 deletions lib/vimcity/vim_city_game.rb
Expand Up @@ -286,9 +286,9 @@ def add_building
return
end

# for deleting buildings
# c = get_cursor_pos
@current_building.add_to_city(@city)
c = get_cursor_pos
@map.add_building(@current_building, c[0], c[1])
@last_chars = @current_building.symbol
end

Expand All @@ -297,7 +297,7 @@ def destroy_building
building, building_coords = @map.destroy_building(c[0], c[1])
return if building.nil?

blank_building =Array.new(building.height) { "."*building.width }
blank_building = Array.new(building.height) { "."*building.width }
print_area_to_buffer(@main_buffer,
building_coords[0],
building_coords[1],
Expand Down

0 comments on commit 08f3a11

Please sign in to comment.