Merge pull request #475 from SamHellawell/0.7.0-fix-equipcrash-linux

Fix crash when equipping item on linux
This commit is contained in:
David Cernat 2018-10-11 22:40:09 +03:00 committed by GitHub
commit db2b3e95b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);