title: Player class property being set to 0 for no explainable reason
body: <p>I'm currently writing a player class for a small text based game. The player has properties such as current and maximum health which are inherited from an actor class. While making the constructor for a default new character I came across a bug with one of the properties being set to 0 for a reason I can not explain.</p>
  
  <p>Here's the relevant info:</p>
  
  <pre><code>public class Player : Actor
  {
      private int _curHunger;
      private int _maxHunger;
  
      public Player()
      {
          this.CurrentHealth = 100;
          this.MaxHealth = 100;
          this.CurrentHunger = 100;
          this.MaxHunger = 100;
      }
  
      public int CurrentHunger
      {
          get { return _curHunger; }
          set 
          {
              _curHunger = value;
              if (_curHunger &gt; _maxHunger)
              {
                  _curHunger = _maxHunger;
              }
              if (_curHunger &lt;= 0)
              {
                  _curHunger = 0;
                  Random HealthLoss = new Random();
                  this.CurrentHealth -= HealthLoss.Next(1,3);
              }
          }
      }
  }
  </code></pre>
  
  <p>The following output is that max hunger becomes 100, while current hunger becomes 0. If I remove the if (_curHunger > _maxHunger) statement current hunger becomes 100. If I set _curHunger to 100 instead of setting it inside the constructor the output becomes is 100 as expected.</p>
  
  <p>The setting of the players current and max health within the actor class are essentially the same and have no such problems.</p>
  
  <pre><code>public int CurrentHealth
  {
      get { return _curHealth; }
      set
      {
          _curHealth = value;
          if (_curHealth &gt; _maxHealth)
          {
              _curHealth = _maxHealth;
          }
          if (_curHealth &lt;= 0)
          {
              MessageBox.Show("The actor died!");
          }
      }
  }
  </code></pre>
  
  <p>I can not for the life of me work out what I've done wrong, I hope this is something obvious that I've missed due to being overly tired.</p>
  
  <p>Thanks in advance for any guidance. If it matters, this is on windows forms.</p>
  
  <p>EDIT: It seems that switching this.CurrentHunger and this.MaxHunger in the constructor has fixed my issue, however this doesn't explain why it worked just fine for current and maximum health while messing up for hunger.</p>