From 1e171ad9fd3b8832bac725aa2f1f6e864c825423 Mon Sep 17 00:00:00 2001 From: Sam Hellawell Date: Thu, 11 Oct 2018 20:13:22 +0100 Subject: [PATCH] Fix crash when equipping item on linux Signed-off-by: Sam Hellawell --- .../mwmp/processors/player/ProcessorPlayerItemUse.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwmp/processors/player/ProcessorPlayerItemUse.hpp b/apps/openmw/mwmp/processors/player/ProcessorPlayerItemUse.hpp index 354e72cf3..330377d7a 100644 --- a/apps/openmw/mwmp/processors/player/ProcessorPlayerItemUse.hpp +++ b/apps/openmw/mwmp/processors/player/ProcessorPlayerItemUse.hpp @@ -28,9 +28,12 @@ namespace mwmp if (!isRequest()) { - LOG_APPEND(Log::LOG_INFO, "- refId: %s, count: %i, charge: %f, enchantmentCharge: %f, soul: %s", + // Due to a bug on Linux w/ vsnprintf, we have to append soul as string here instead + std::string msgStr = "- refId: %s, count: %i, charge: %f, enchantmentCharge: %f, soul: " + player->usedItem.soul; + LOG_APPEND(Log::LOG_INFO, msgStr.c_str(), player->usedItem.refId.c_str(), player->usedItem.count, player->usedItem.charge, - player->usedItem.enchantmentCharge, player->usedItem.soul.c_str()); + player->usedItem.enchantmentCharge); + MWWorld::Ptr playerPtr = MWBase::Environment::get().getWorld()->getPlayerPtr(); MWWorld::InventoryStore &inventoryStore = playerPtr.getClass().getInventoryStore(playerPtr);