Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into canary
Browse files Browse the repository at this point in the history
  • Loading branch information
kokekanon committed Nov 8, 2024
2 parents 9e3ebdc + 155183e commit b7ac615
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
6 changes: 5 additions & 1 deletion modules/game_questlog/questlog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,18 @@ function terminate()

destroyWindows()
questLogButton:destroy()
questLogButton = nil
end

function destroyWindows()
if questLogWindow then
questLogWindow:destroy()
questLogWindow = nil
end

if questLineWindow then
questLineWindow:destroy()
questLineWindow = nil
end
end

Expand Down Expand Up @@ -69,6 +72,7 @@ function onGameQuestLine(questId, questMissions)
end
if questLineWindow then
questLineWindow:destroy()
questLineWindow = nil
end

questLineWindow = g_ui.createWidget('QuestLineWindow', rootWidget)
Expand All @@ -85,7 +89,7 @@ function onGameQuestLine(questId, questMissions)
})

for i, questMission in pairs(questMissions) do
local name, description = unpack(questMission)
local name, description, missionId = unpack(questMission)

local missionLabel = g_ui.createWidget('MissionLabel')
missionLabel:setText(name)
Expand Down
2 changes: 1 addition & 1 deletion src/client/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ void Game::processQuestLog(const std::vector<std::tuple<uint16_t, std::string, b
g_lua.callGlobalField("g_game", "onQuestLog", questList);
}

void Game::processQuestLine(const uint16_t questId, const std::vector<std::tuple<std::string, std::string>>& questMissions)
void Game::processQuestLine(const uint16_t questId, const std::vector<std::tuple<std::string_view, std::string_view, uint16_t>>& questMissions)
{
g_lua.callGlobalField("g_game", "onQuestLine", questId, questMissions);
}
Expand Down
2 changes: 1 addition & 1 deletion src/client/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ class Game

// questlog
static void processQuestLog(const std::vector<std::tuple<uint16_t, std::string, bool>>& questList);
static void processQuestLine(const uint16_t questId, const std::vector<std::tuple<std::string, std::string>>& questMissions);
static void processQuestLine(const uint16_t questId, const std::vector<std::tuple<std::string_view, std::string_view, uint16_t>>& questMissions);

// modal dialogs >= 970
static void processModalDialog(const uint32_t id, const std::string_view title, const std::string_view message, const std::vector<std::tuple<uint8_t, std::string>>
Expand Down
8 changes: 6 additions & 2 deletions src/client/protocolgameparse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2936,12 +2936,16 @@ void ProtocolGame::parseQuestLine(const InputMessagePtr& msg)
const uint16_t questId = msg->getU16();

const uint8_t missionCount = msg->getU8();
std::vector<std::tuple<std::string, std::string>> questMissions;
std::vector<std::tuple<std::string_view, std::string_view, uint16_t>> questMissions;

for (auto i = 0; i < missionCount; ++i) {
auto missionId = 0;
if (g_game.getClientVersion() >= 1200) {
missionId = msg->getU16();
}
const auto& missionName = msg->getString();
const auto& missionDescrition = msg->getString();
questMissions.emplace_back(missionName, missionDescrition);
questMissions.emplace_back(missionName, missionDescrition, missionId);
}

g_game.processQuestLine(questId, questMissions);
Expand Down
2 changes: 1 addition & 1 deletion src/client/protocolgamesend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ void ProtocolGame::sendChangeOutfit(const Outfit& outfit)
}
}

if (g_game.getClientVersion() >= 1340) {
if (g_game.getClientVersion() >= 1334) {
msg->addU8(static_cast<uint8_t>(outfit.hasMount()));
}

Expand Down

0 comments on commit b7ac615

Please sign in to comment.