Created
September 11, 2015 12:30
-
-
Save dalvorsn/181968ae477debd90d2d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int32_t LuaScriptInterface::luaGetCreatureName(lua_State* L) { | |
//getCreatureName(cid) | |
ScriptEnviroment* env = getEnv(); | |
if(Creature* creature = env->getCreatureByUID(popNumber(L))) { | |
if(Monster* monster = creature->getMonster()) | |
lua_pushstring(L, monster->getMonsterType()->name.c_str() ); | |
else | |
lua_pushstring(L, creature->getName().c_str()); | |
} else { | |
errorEx(getError(LUA_ERROR_CREATURE_NOT_FOUND)); | |
lua_pushboolean(L, false); | |
} | |
return 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment