1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-30 03:32:36 +00:00
OpenMW/apps/openmw/mwrender/actorutil.cpp
elsid 1d94527a19
Avoid using settings in components to get actor model
Settings::Values are initialized only for engine. Accessing them from other
binaries leads to a crash.
2023-09-27 21:00:46 +02:00

33 lines
954 B
C++

#include "actorutil.hpp"
#include <components/settings/values.hpp>
namespace MWRender
{
const std::string& getActorSkeleton(bool firstPerson, bool isFemale, bool isBeast, bool isWerewolf)
{
if (!firstPerson)
{
if (isWerewolf)
return Settings::models().mWolfskin;
else if (isBeast)
return Settings::models().mBaseanimkna;
else if (isFemale)
return Settings::models().mBaseanimfemale;
else
return Settings::models().mBaseanim;
}
else
{
if (isWerewolf)
return Settings::models().mWolfskin1st;
else if (isBeast)
return Settings::models().mBaseanimkna1st;
else if (isFemale)
return Settings::models().mBaseanimfemale1st;
else
return Settings::models().mXbaseanim1st;
}
}
}