//================================================
//++++++++++++++++++++++++++++++++++++++++++++++++
//------------------------------------------------


class Ownedbutton2 extends Button1;

var DeusExPlayer VaultOwner;
var(events) Name VaultName;

function Frob(Actor Frobber, Inventory frobWith)
{
local DeusExPlayer player;
local OwnedButton2 but2;
local BankTakeOut TakeOut;

	player=DeusExPlayer(Frobber);
	But2 = None;

	foreach AllActors(class'OwnedButton2', But2)
	{
		If((But2.VaultOwner == Player) && (But2 != Self))
		{
			player.ClientMessage("You already have a vault!");
			return;
		}
	}

	if (But2 == None)
	{
		if(VaultOwner==None)
		{
			VaultOwner=player;
			player.ClientMessage("This vault is now yours");
			Super.Frob(Frobber,frobWith);
		}
		else if(VaultOwner==player)
		{	
			Super.Frob(Frobber,frobWith);
		}
	
		else
		{
			player.ClientMessage("This isn't your vault!");
			return;
		}
	}
}	
