class RPGSpawn extends Decoration;

var class<Inventory> SpawnClass;
var class<Ammo> SpawnAmmo;
var DeusExPlayer Player;

function SpawnIt()
{
	local Inventory SpawnObject;
	local Ammo AmmoNeeded;
	local vector loc;

//==New 'n' Phat===
	SpawnObject = Spawn(SpawnClass);
	SpawnObject.Frob(Player,None);
	Player.inventory.bInObjectBelt = True;
	SpawnObject.Destroy();
	if(SpawnObject != None)
		SpawnObject.Destroy();



//======Old, Slightly Buggy Version======
//	loc = Player.Location;
//	loc.Z += 128;

//	if ( Role == ROLE_Authority )
//	{
//			SpawnObject.SetCollision(false, false, false);
//			SpawnObject = spawn(SpawnClass);
//			SpawnObject.RespawnTime = 0.0;
//			SpawnObject.SetCollision(false, false, false);
//			SpawnObject.BecomeItem();
//			SpawnObject.bHeldItem = true;
//			SpawnObject.SpawnCopy(Player);
//		//if( Level.Game.ShouldRespawn(self) )
//		if(SpawnObject.Owner == None)
//		{
//			If (SpawnObject != None)
//			{
//				SpawnObject.Destroy();
//			}
//		}
//	}



//====Crap Version=====
//	Player.HandleItemPickup(SpawnObject,True);
//	Player.AddInventory( SpawnObject );
//	SpawnObject.GiveTo(Player);
//	SpawnObject.Frob(Player,none);
//	SpawnObject.bInObjectBelt = True;
//	if(SpawnObject.Owner == None)


}

defaultproperties
{
     bHidden=True
     Physics=PHYS_None
     DrawType=DT_Sprite
     Texture=Texture'Engine.S_Inventory'
     DrawScale=1.000000
     CollisionRadius=0.000001
     CollisionHeight=0.000001
     Mass=0.000000
     Buoyancy=0.000000
     bBlockActors=False
     bBlockPlayers=False
     bCollideActors=False
     bCollideWorld=False
     bProjTarget=False
}
