Beispiel #1
0
int32_t NpcScriptInterface::luaGetNpcName(lua_State* L)
{
	//getNpcName()
	Npc* npc = getScriptEnv()->getNpc();
	if (npc) {
		LuaScriptInterface::pushString(L, npc->getName());
	} else {
		pushBoolean(L, false);
	}
	return 1;
}
Beispiel #2
0
int NpcScriptInterface::luaGetNpcName(lua_State* L)
{
	//getNpcName()
	ScriptEnviroment* env = getScriptEnv();

	Npc* npc = env->getNpc();
	if(npc){
		lua_pushstring(L, npc->getName().c_str());
	}
	else{
		lua_pushstring(L, "");
	}

	return 1;
}