function UpdateTime()
{
   %hour = getWord($clock, 9);
   %day = getWord($clock, 3);
   
   %hour = %hour+100;
   
   if(%hour > 2400)
   {
      %day = %day++;
      
      %hour = "000";          
      
      // consume food
      
      ConsumeFood();
      
      AddUpgradePoints();   
   }
   
   // if they are starving
   
   if($starving $= true && $food >= GetTotalNumPeople())
      ConsumeFood();
   
   $clock = "Day" @ "   " @ %day @ "   " @ "Hour" @ "   " @ %hour;
   
   $mastertime++;
   
   // if the gang is infected
   
   if($disease $= true && $diseasetime $= $mastertime)
      Infected();

   Repair();     

   ReplaceTires();
   
   CombatMoralCheck();
   
   CheckTradeInTime();
   
   Clock.text = $clock;   
   
   // end of game
   
   if(%day $= 150)
   {
      BadEndGame();
      return true;
   }
      
}
