Why am I getting nil?

Code:
#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
#  A battler class with methods for sprites and actions added. This class
# is used as a super class of the Game_Actor class and Game_Enemy class.
#==============================================================================

class Game_Battler < Game_BattlerBase
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor   :speed                          # action speed
  attr_accessor   :var1                           # not real variable name
  attr_accessor   :var2                           # not real variable name
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    @battler_name = ""
    @battler_hue = 0
    @actions = []
    @speed = 0
    @result = Game_ActionResult.new(self)
    @last_target_index = 0
    @guarding = false
    @var1, @var2 = 0
    # var2 is nil somehow, why?
    msgbox(var2) # Debugging to get var2 value
    clear_sprite_effects
    super
  end

Why is var2 nil? I serious can't find what is wrong and its extremely frustrating.

By the way: I changed the variable names for posting, it isn't the problem. This is a patch that overrides or adds the the Game_Battler class.

Edit: Nevermind, I figured it out.

Code:
# Separate these variables
@var1 = 0
@var2 = 0
Code:
# This
@var1, @var2 = 0
# Is equivalent to this
@var1, @var2 = 0, nil
# Which is expanded into
@var1 = 0
@var2 = nil
If you want to assign multiple variables on one line, it's

@var1 = @var2 = 0

This works because many languages (including Ruby) do assignment from right to left.

Original thread: https://forums.rpgmakerweb.com/threads/why-am-i-getting-nil.77271/