#include "../mainproc/GameMain.h"
#include "WorldMap.h"

CWorldMapFrame*			g_pWorldMapFrame = NULL;

int LuaFunc_GetPlayerWorldMapPos( lua_State* L );

// ----------------------------------------------------------------------------
CWorldMapFrame::CWorldMapFrame(CInterface* object)
	: CInterfaceBase(object)
{
	g_pWorldMapFrame = this;
}

// ----------------------------------------------------------------------------
CWorldMapFrame::~CWorldMapFrame()
{
	g_pWorldMapFrame = NULL;
}
// ----------------------------------------------------------------------------
void CWorldMapFrame::RegisterFunc()
{
	lua_State* L = GetLuaStateWorld();
	if (L)
	{
		lua_register( L, "GetPlayerWorldMapPos",			LuaFunc_GetPlayerWorldMapPos );
	}
}
// ----------------------------------------------------------------------------
int LuaFunc_GetPlayerWorldMapPos( lua_State* L )
{
	CRoleSprite*	player	= g_pGameMain->GetPlayer();
	CRuVector3		pos		= player->GetPos();


	lua_pushnumber( L, pos.m_x	);
	lua_pushnumber( L, pos.m_z	);

	return 2;
}
