this.SetBaseGoalType("mapgoal_camp.gm");

this.GoalType = "Snipe";
this.MaxUsers_InProgress(1);

//////////////////////////////////////////////////////////////////////////
this.BaseInitNewGoal = this.InitNewGoal;
this.InitNewGoal = function()
{
	// call the base goal init before we do custom stuff.
	if(this.BaseInitNewGoal)
	{
		this.BaseInitNewGoal();
	}
};

//////////////////////////////////////////////////////////////////////////
this.BaseUpgradeVersion = this.UpgradeVersion;
this.UpgradeVersion = function(Props)
{
	if(Props.Version==0)
	{
		this.SetPosition(this.GetPosition() + Util.WaypointGoalOffset);
	}

	// old maps had all snipe goals limited to FG42,K43,GARAND and it did not work in ETNam or ETBlight mods,
	// that's why we ignore Weapons property unless it has less than 3 weapons
	if(!Props.Weapons || tableCount(Props.Weapons)==0 || tableCount(Props.Weapons) > 2)
	{
		// fill in all the known sniper weapons by default
		if (Util.IndexedSniperWeapons)
		{
			Props.Weapons = tableDuplicate(Util.IndexedSniperWeapons);
		}
		else
		{
			Util.MapDebugPrint(this.GoalType + ": Error : No Util.IndexedSniperWeapons table");
		}
	}

	// call base goal upgrade. cs: do this last so LimitToWeapon includes all weapons.
	if(this.BaseUpgradeVersion)
	{
		this.BaseUpgradeVersion(Props);
	}
};

//////////////////////////////////////////////////////////////////////////
