Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: invalid mount offer from store #1933

Merged
merged 3 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion data/modules/scripts/gamestore/gamestore.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1278,7 +1278,7 @@ GameStore.Categories = {
icons = { "Corpsefire_Skull.png" },
name = "Corpsefire Skull",
price = 750,
id = 220,
id = 221,
description = "{character}\n{speedboost}\n\n<i>Skulls are the infernal heralds of untamed power. Bodies are obsolete when sinister forces animate your being. Embrace their presence and command the devastating might that awaits on the back of an eerie Corpsefire Skull!</i>",
type = GameStore.OfferTypes.OFFER_TYPE_MOUNT,
state = GameStore.States.STATE_NEW,
Expand Down
7 changes: 6 additions & 1 deletion data/modules/scripts/gamestore/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2137,7 +2137,12 @@ function sendHomePage(playerId)
msg:addString(offer.icons[1])
elseif type == GameStore.ConverType.SHOW_MOUNT then
local mount = Mount(offer.id)
msg:addU16(mount:getClientId())
if mount then
msg:addU16(mount:getClientId())
else
logger.debug("[sendHomePage] mount with id {} not exist, ignoring to avoid a debug on the client", offer.id)
msg:addU16(0)
end
elseif type == GameStore.ConverType.SHOW_ITEM then
msg:addU16(offer.itemtype)
elseif type == GameStore.ConverType.SHOW_OUTFIT then
Expand Down
3 changes: 2 additions & 1 deletion src/lua/functions/lua_functions_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,8 @@ std::string LuaFunctionsLoader::getFormatedLoggerMessage(lua_State* L) {
try {
return fmt::vformat(format, args);
} catch (const fmt::format_error &e) {
g_logger().error("[{}] format error: {}", __FUNCTION__, e.what());
g_logger().debug("[{}] format error: {}", __FUNCTION__, e.what());
reportErrorFunc(fmt::format("Format error, {}", e.what()));
}

return {};
Expand Down
Loading