Skip to content

Commit

Permalink
fix: packet parseRemoveMagicEffect (#1070)
Browse files Browse the repository at this point in the history
  • Loading branch information
kokekanon authored Jan 28, 2025
1 parent 90b4062 commit a5dd721
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/game_cooldown/cooldown.lua
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ function onSpellGroupCooldown(groupId, duration)
removeEvent(icon.event)
end

progressRect.icon = icon
if progressRect then
progressRect.icon = icon
removeEvent(progressRect.event)
local updateFunc = function()
updateCooldown(progressRect, duration)
Expand Down
1 change: 1 addition & 0 deletions src/client/protocolgame.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ class ProtocolGame final : public Protocol
void parseCloseNpcTrade(const InputMessagePtr&);
void parseWorldLight(const InputMessagePtr& msg);
void parseMagicEffect(const InputMessagePtr& msg);
void parseRemoveMagicEffect(const InputMessagePtr& msg);
void parseAnimatedText(const InputMessagePtr& msg);
void parseDistanceMissile(const InputMessagePtr& msg);
void parseAnthem(const InputMessagePtr& msg);
Expand Down
17 changes: 16 additions & 1 deletion src/client/protocolgameparse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,11 @@ void ProtocolGame::parseMessage(const InputMessagePtr& msg)
parseMagicEffect(msg);
break;
case Proto::GameServerTextEffect:
parseAnimatedText(msg);
if (g_game.getClientVersion() >= 1320) {
parseRemoveMagicEffect(msg);
} else {
parseAnimatedText(msg);
}
break;
case Proto::GameServerMissleEffect:
if (g_game.getFeature(Otc::GameAnthem)) {
Expand Down Expand Up @@ -1706,6 +1710,17 @@ void ProtocolGame::parseMagicEffect(const InputMessagePtr& msg)
g_map.addThing(effect, pos);
}

void ProtocolGame::parseRemoveMagicEffect(const InputMessagePtr& msg)
{
getPosition(msg);
uint16_t effectId = g_game.getFeature(Otc::GameEffectU16) ? msg->getU16() : msg->getU8();
if (!g_things.isValidDatId(effectId, ThingCategoryEffect)) {
g_logger.warning(stdext::format("[ProtocolGame::parseRemoveMagicEffect] - Invalid effectId type {}", effectId));
return;
}
// TO-DO
}

void ProtocolGame::parseAnimatedText(const InputMessagePtr& msg)
{
const auto& position = getPosition(msg);
Expand Down

0 comments on commit a5dd721

Please sign in to comment.