So I made this lua function, but it returns an empty string whether the item has a special description or not. Anyone knows why and how to fix it?
Code:
int32_t LuaScriptInterface::luaGetItemDesc(lua_State* L)
{
//getItemDesc(uid)
uint32_t uid = popNumber(L);
ScriptEnvironment* env = getScriptEnv();
Item* item = env->getItemByUID(uid);
if (!item) {
reportErrorFunc(getErrorDesc(LUA_ERROR_ITEM_NOT_FOUND));
pushBoolean(L, false);
return 1;
}
else {
const std::string& specialDescription = item->getSpecialDescription();
pushString(L, specialDescription);
}
pushBoolean(L, true);
return 1;
}