|
|
|
@ -60,6 +60,7 @@ DedicatedPlayer::DedicatedPlayer(RakNet::RakNetGUID guid) : BasePlayer(guid)
|
|
|
|
|
MWBase::World *world = MWBase::Environment::get().getWorld();
|
|
|
|
|
npc = *world->getPlayerPtr().get<ESM::NPC>()->mBase;
|
|
|
|
|
npc.mId = "Dedicated Player";
|
|
|
|
|
previousRace = npc.mRace;
|
|
|
|
|
}
|
|
|
|
|
DedicatedPlayer::~DedicatedPlayer()
|
|
|
|
|
{
|
|
|
|
@ -142,8 +143,6 @@ void DedicatedPlayer::move(float dt)
|
|
|
|
|
|
|
|
|
|
void DedicatedPlayer::setBaseInfo()
|
|
|
|
|
{
|
|
|
|
|
static std::string previousRace;
|
|
|
|
|
|
|
|
|
|
// Use the previous race if the new one doesn't exist
|
|
|
|
|
if (!RecordHelper::doesRaceExist(npc.mRace))
|
|
|
|
|
npc.mRace = previousRace;
|
|
|
|
@ -175,6 +174,8 @@ void DedicatedPlayer::setShapeshift()
|
|
|
|
|
if (reference)
|
|
|
|
|
isNpc = ptr.getTypeName() == typeid(ESM::NPC).name();
|
|
|
|
|
|
|
|
|
|
if (creatureRefId != previousCreatureRefId)
|
|
|
|
|
{
|
|
|
|
|
if (!creatureRefId.empty() && RecordHelper::doesCreatureExist(creatureRefId))
|
|
|
|
|
{
|
|
|
|
|
if (isNpc)
|
|
|
|
@ -227,6 +228,9 @@ void DedicatedPlayer::setShapeshift()
|
|
|
|
|
reloadPtr();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
previousCreatureRefId = creatureRefId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (ptr.getTypeName() == typeid(ESM::NPC).name())
|
|
|
|
|
{
|
|
|
|
|
MWBase::Environment::get().getMechanicsManager()->setWerewolf(ptr, isWerewolf);
|
|
|
|
|