#include "scripts/common.txt"
class TurokShopPointExit : ScriptObject {
    kActor @self;
	//------------------------------------------------------------------------------------------------------------------------
    TurokShopPointExit(kActor @actor) {
        @self = actor;
		self.Flags() |= AF_CANBETOUCHED;
    }
	//------------------------------------------------------------------------------------------------------------------------
    void OnTick(void) {
		//self.PlaySound("sounds/shaders/generic_187.ksnd");
    }
	//------------------------------------------------------------------------------------------------------------------------
    void OnSpawn(void) {
    }
	//------------------------------------------------------------------------------------------------------------------------
	void OnTouch(kActor @theActorThatTouchedMe) {
		int sector;
		kVec3 pos;
		float yaw;
		int mapID;
		GameVariables.GetInt("BP.ShopWarpSector", sector);
        GameVariables.GetVector("BP.ShopWarpPos", pos);
        GameVariables.GetFloat("BP.ShopWarpYaw", yaw);
		GameVariables.GetInt("BP.ShopWarpMap", mapID);
		// Sys.Print("Sector: " + sector + ", Pos: " + pos.ToString() + ", yaw: " + yaw + ", mapID: " + mapID);
		PlayLoop.StartFreeWarp(theActorThatTouchedMe,
					   pos, //pos
					   yaw, //yaw
					   sector, //sectorindex
					   mapID); //mapid
	}
	//------------------------------------------------------------------------------------------------------------------------
};
