1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 23:23:52 +00:00

[Client] Add logging for invalid attempts at getting creature stats

This commit is contained in:
David Cernat 2020-08-05 11:15:49 +02:00
parent baa9446cd1
commit 958be0b114

View file

@ -2,6 +2,16 @@
#include <stdexcept>
/*
Start of tes3mp addition
Include additional headers for multiplayer purposes
*/
#include <components/openmw-mp/TimedLog.hpp>
/*
End of tes3mp addition
*/
#include <components/esm/defs.hpp>
#include "../mwbase/environment.hpp"
@ -61,6 +71,18 @@ namespace MWWorld
MWMechanics::CreatureStats& Class::getCreatureStats (const Ptr& ptr) const
{
/*
Start of tes3mp addition
This is a common error in multiplayer, so additional logging has been added for it
*/
LOG_MESSAGE_SIMPLE(TimedLog::LOG_ERROR, "Attempt at getting creatureStats for %s %i-%i which is a %s!",
ptr.getCellRef().getRefId().c_str(), ptr.getCellRef().getRefNum().mIndex, ptr.getCellRef().getMpNum(),
ptr.getClass().getTypeName().c_str());
/*
End of tes3mp addition
*/
throw std::runtime_error ("class does not have creature stats");
}