Skip to content

Commit

Permalink
rubocop -A
Browse files Browse the repository at this point in the history
  • Loading branch information
ChillerDragon committed Jan 20, 2024
1 parent f981956 commit 0dcb85a
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/08_gui_snapshot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def draw
own_tee = @tees[@client.local_client_id]
own_tee = @tees.first.last if own_tee.nil?
offset = center_around_tee(own_tee)
@tees.each do |_id, tee|
@tees.each_value do |tee|
@tee_image.draw(tee.x + offset.x, tee.y + offset.y)
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/array.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def groups_of(max_size)
group = []
end
end
groups.push(group) unless group.size.zero?
groups.push(group) unless group.empty?
groups
end
end
2 changes: 1 addition & 1 deletion lib/context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def initialize(message, keys = {})
end

def verify
@data.each do |key, _value|
@data.each_key do |key|
next if @old_data.key? key

raise "Error: invalid data key '#{key}'\n valid keys: #{@old_data.keys}"
Expand Down
2 changes: 1 addition & 1 deletion lib/game_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def on_shutdown
return if call_hook(:shutdown, Context.new(nil)).nil?

puts '[gameserver] disconnecting all clients ...'
@server.clients.each do |_id, client|
@server.clients.each_value do |client|
@server.send_ctrl_close(client, @server.shutdown_reason)
end
puts '[gameserver] shutting down ...'
Expand Down
2 changes: 1 addition & 1 deletion lib/snapshot/items/tune_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def initialize(hash_or_raw)
end

def validate
@fields.select(&:nil?).empty?
@fields.none?(&:nil?)
end

def init_unpacker(u)
Expand Down
2 changes: 1 addition & 1 deletion lib/snapshot/snap_item_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def initialize(hash_or_raw)
end

def validate
@fields.select(&:nil?).empty?
@fields.none?(&:nil?)
end

def init_unpacker(u)
Expand Down
2 changes: 1 addition & 1 deletion lib/teeworlds_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ def process_chunk(chunk)

def process_server_packet(packet)
data = packet.payload
if data.size.zero?
if data.empty?
puts 'Error: packet payload is empty'
puts packet
return
Expand Down
2 changes: 1 addition & 1 deletion lib/teeworlds_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ def do_snapshot
# msg_snap_single = NetChunk.create_header(vital: false, size: data.size + 1) +
# [pack_msg_id(NETMSG_SNAPSINGLE, system: true)] +
# data
@clients.each do |_id, client|
@clients.each_value do |client|
next unless client.in_game?

@netbase.send_packet(msg_snap_empty, chunks: 1, client:)
Expand Down

0 comments on commit 0dcb85a

Please sign in to comment.