Skip to content

Commit

Permalink
Fix nil signs (bug #12)
Browse files Browse the repository at this point in the history
  • Loading branch information
nick committed Jul 22, 2014
1 parent 6f05f3b commit 754f598
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/logicbot/objects.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def initialize bot, pos, in_channels, out_channel, needs_update = false, metadat
@out_channel = out_channel
@needs_update = needs_update
@metadata = metadata
@signs = [''] * 6 # [block_face] = sign_text
@signs = [''] * 24 # [block_face] = sign_text
@last_state = nil
end

Expand Down
2 changes: 1 addition & 1 deletion lib/logicbot/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def get_event
@block_cache[pos] = data[6].to_i
return {:type => :block_change, :pos => pos, :id => data[6].to_i}
when 'S' # Sign change
return {:type => :sign_update, :pos => [data[3].to_i, data[4].to_i, data[5].to_i], :facing => data[6].to_i, :text => data[7 .. -1].join(',')}
return {:type => :sign_update, :pos => [data[3].to_i, data[4].to_i, data[5].to_i], :facing => data[6].to_i, :text => (data[7 .. -1] or []).join(',')}
when 'N' # Player join
@players[data[1].to_i] = data[2 .. -1].join(',')
return {:type => :player_join, :id => data[1].to_i, :name => data[2 .. -1].join(',')}
Expand Down

0 comments on commit 754f598

Please sign in to comment.