Skip to content

Commit

Permalink
Fix rubocop offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
ChillerDragon committed Feb 21, 2024
1 parent d9cd770 commit 333a132
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/game_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def call_hook(hook_sym, context, optional = nil)

def on_emoticon(chunk, _packet)
msg = ClEmoticon.new(chunk.data[1..])
return if call_hook(:emote, Context.new(msg, chunk:, packet:)).nil?
call_hook(:emote, Context.new(msg, chunk:, packet:)).nil?
end

def on_info(chunk, packet)
Expand Down Expand Up @@ -145,7 +145,7 @@ def on_input(chunk, packet)
return if call_hook(:input, Context.new(msg, chunk:, packet:)).nil?

dir = msg.direction
puts "#{packet.client.player.id} tried to move #{dir}" unless dir.zero?
puts "#{packet.client.player.id} tried to move #{dir}" unless dir.zero?
end

def on_client_drop(client, reason = nil)
Expand Down
3 changes: 2 additions & 1 deletion lib/messages/cl_input.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
#
# Client -> Server
class ClInput
attr_accessor :ack_game_tick, :prediction_tick, :size, :direction, :target_x, :target_y, :jump, :fire, :hook, :player_flags, :wanted_weapon, :next_weapon, :prev_weapon, :ping
attr_accessor :ack_game_tick, :prediction_tick, :size, :direction, :target_x, :target_y, :jump, :fire, :hook,
:player_flags, :wanted_weapon, :next_weapon, :prev_weapon, :ping

def initialize(hash_or_raw)
if hash_or_raw.instance_of?(Hash)
Expand Down

0 comments on commit 333a132

Please sign in to comment.