//==================================================================================
// sgMinigun
// HISTORY?: Well, I'm sure it's here just to use a different ammo class
// than the enforcer.
//
// WHAT NOW: I'm here to edit this to prevent multigunning.
// This will be optional to server admins however if they want to enable it or not.
//==================================================================================
class sgMinigun extends minigun2;

state NormalFire
{
	function Tick( float DeltaTime )
	{
		if (Owner==None) 
			AmbientSound = None;

		if ( Pawn(owner).PlayerReplicationInfo.bFeigningDeath == true && SiegeGI(Level.Game).AllowMultiGunning == false )
			{
				log("MultiGunning is Forbidden!");
				GotoState('FinishFire');
			}

	}
}

state AltFiring
{
	function Tick( float DeltaTime )
	{
		if (Owner==None) 
		{
			AmbientSound = None;
			GotoState('Pickup');
		}			

		if	( bFiredShot && ((pawn(Owner).bAltFire==0) || bOutOfAmmo) ) 
			GoToState('FinishFire');

		if ( Pawn(owner).PlayerReplicationInfo.bFeigningDeath == true && SiegeGI(Level.Game).AllowMultiGunning == false )
			{
				log("MultiGunning is Forbidden!");
				GotoState('FinishFire');
			}
	}
}

/*
state ClientFiring
{
	simulated function AnimEnd()
	{
		//log("Tracker 1");
		if ( (Pawn(Owner) == None) || (AmmoType.AmmoAmount <= 0) )
			{
				PlayUnwind();
				GotoState('');
			}
		else
			if ( Pawn(Owner) != None )
				{
					//log("Tracker 2");
					//log("PlayerReplicationInfo(owner):"@PlayerReplicationInfo(owner));
					//log("owner:"@owner);

					if ( Pawn(owner).PlayerReplicationInfo.bFeigningDeath == false )
						{
							//log("Tracker 3");
							if ( !bCanClientFire )
								GotoState('');
							else
								if ( Pawn(Owner).bFire != 0 )
									Global.ClientFire(0);
								else
									if ( Pawn(Owner).bAltFire != 0 )
										Global.ClientAltFire(0);
									else
										{
											PlayUnwind();
											GotoState('ClientFinish');
										}
							//log("Tracker 4");
						}
					else
						{
							PlayUnwind();
							GotoState('ClientFinish');
						}
				}
	}
}
*/

defaultproperties
{
    AmmoName=Class'sgMiniammo'
}
