Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [11:51:34 AM] Pursche: FixLanguageSkills() changes did not help.
- [12:06:11 PM] Pursche: Still stating that I don't know the language
- [12:06:29 PM] Pursche: It fails here:
- [12:06:47 PM] Pursche: if (langDesc->skill_id != 0 && !sender->HasSkill(langDesc->skill_id))
- {
- // also check SPELL_AURA_COMPREHEND_LANGUAGE (client offers option to speak in that language)
- Unit::AuraEffectList const& langAuras = sender->GetAuraEffectsByType(SPELL_AURA_COMPREHEND_LANGUAGE);
- bool foundAura = false;
- for (Unit::AuraEffectList::const_iterator i = langAuras.begin(); i != langAuras.end(); ++i)
- {
- if ((*i)->GetMiscValue() == int32(lang))
- {
- foundAura = true;
- break;
- }
- }
- if (!foundAura)
- {
- SendNotification(LANG_NOT_LEARNED_LANGUAGE); // HERE
- recvData.rfinish();
- return;
- }
- }
- [12:07:02 PM] Pursche: I'm trying this as a temporary fix: if (langDesc->skill_id != 0 && !sender->HasSkill(langDesc->skill_id) && sender->getORace() == sender->getRace())
- [4:37:12 PM] Pursche: Tried it
- [4:37:55 PM] Pursche: It kinda worked...
- [4:38:06 PM] Pursche: It seems like there is a clientside check and a serverside, the serverside is fixed
- [4:38:12 PM] Pursche: I was a gnome, I got turned into a warlock
- [4:38:41 PM] Pursche: Immediately on spawning I tried to talk, resulting in this
- [4:39:07 PM] Pursche: However, if I go into the language settings and pick Common again, it works:
- [4:39:40 PM] Pursche: Here's the code I'm running for it to work
- [4:39:44 PM] Pursche: void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
- {
- uint32 type;
- uint32 lang;
- recvData >> type;
- recvData >> lang;
- // if (sWorld->getBoolConfig(BATTLEGROUND_CROSSFACTION_ENABLED) /*&& lang != LANG_ADDON*/) TODO: Figure out if this is needed in next CFBG
- {
- switch (type)
- {
- case CHAT_MSG_BATTLEGROUND:
- case CHAT_MSG_BATTLEGROUND_LEADER:
- lang = LANG_UNIVERSAL;
- default:
- break;
- }
- }
- Player* sender = GetPlayer();
- if (sender->getORace() != sender->getRace())
- lang = LANG_UNIVERSAL;
- if (type >= MAX_CHAT_MSG_TYPE)
- {
- TC_LOG_ERROR("network", "CHAT: Wrong message type received: %u", type);
- recvData.rfinish();
- return;
- }
- if (lang == LANG_UNIVERSAL && type != CHAT_MSG_AFK && type != CHAT_MSG_DND && sender->getORace() == sender->getRace())
- {
- TC_LOG_ERROR("entities.player.cheat", "CMSG_MESSAGECHAT: Possible hacking-attempt: %s tried to send a message in universal language", GetPlayerInfo().c_str());
- SendNotification(LANG_UNKNOWN_LANGUAGE);
- recvData.rfinish();
- return;
- }
- [4:40:06 PM] Pursche: As well as your updated FixLanguageSkills function, but that didn't seem to help. :/
- [4:40:18 PM] Pursche: I'm off to bed, please tell me what you think when you see this
- [4:42:23 PM] lordpsyan: Where did you place that code? I gotta stop working with 10 scripts at a time lol
- [4:43:17 PM] Pursche: That code is at the top of WorldSession::HandleMessagechatOpcode
- [4:43:54 PM] Pursche: There is more to the function below what I pasted but it's unchanged
- [4:44:49 PM] Pursche: My changes are setting lang to LANG_UNIVERSAL if the player is CF'ed, and changing the last if case I pasted to only apply to non CF'ed players
- [4:45:02 PM] lordpsyan: if (spell->HasEffect(SPELL_EFFECT_LANGUAGE))
- [4:45:06 PM] lordpsyan: try changing that to
- [4:45:16 PM] lordpsyan: if (spell->HasEffect(SPELL_EFFECT_LANGUAGE) || spell->HasEffect(SPELL_AURA_COMPREHEND_LANGUAGE) )
- [4:45:25 PM] Pursche: It doesnt matter
- [4:45:41 PM] Pursche: The problems I am having in the first printscreen is clientside
- [4:45:50 PM] lordpsyan: there has to be an easier way, like ignoring the config settings for universal speaking, just in battlegrounds.
- [4:45:55 PM] lordpsyan: yeah
- [4:45:59 PM] Pursche: I put a breakpoint in the handleopcode function and it never triggers
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement