Hello guys, I did a function in my source called "doCreatureCastSpell (uid, spell)" so that ta give an error:
And giving this error in this part:
This is the function code:
Someone here could tell me how to fix this error?
Awaiting response
Code:
In static member function `static int32_t LuaScriptInterface::luaDoCreatureCastSpell(lua_State*)':
expected primary-expression before ',' token
And giving this error in this part:
Code:
ret = g_spells->getInstantSpellByName(spell)->castSpell(Creature, spell);
This is the function code:
Code:
int32_t LuaScriptInterface::luaDoCreatureCastSpell(lua_State* L)
{
//doCreatureCastSpell(uid, spell)
std::string spell = popString(L);
ScriptEnviroment* env = getEnv();
Creature* creature = env->getCreatureByUID(popNumber(L));
if(!creature)
{
errorEx(getError(LUA_ERROR_CREATURE_NOT_FOUND));
lua_pushboolean(L, false);
return 1;
}
ReturnValue ret = RET_NOERROR;
ret = g_spells->getInstantSpellByName(spell)->castSpell(Creature, spell);
if(ret == RET_NOERROR || (ret == RET_NEEDEXCHANGE && !g_config.getBool(ConfigManager::BUFFER_SPELL_FAILURE)))
return true;
lua_pushboolean(L, true);
return 1;
}
Someone here could tell me how to fix this error?
Awaiting response