[Client] Make creature disguises update correctly

This commit is contained in:
David Cernat 2018-04-13 09:50:13 +03:00
parent 9bd79ba498
commit acb1335d78

View file

@ -159,7 +159,9 @@ void DedicatedPlayer::setBaseInfo()
reloadPtr(); reloadPtr();
} }
setEquipment(); // Only set equipment if the player isn't disguised as a creature
if (ptr.getTypeName() == typeid(ESM::NPC).name())
setEquipment();
previousRace = npc.mRace; previousRace = npc.mRace;
} }
@ -192,19 +194,22 @@ void DedicatedPlayer::setShapeshift()
if (creatureRecordId.empty()) if (creatureRecordId.empty())
{ {
creature.mId = "Dedicated Player"; creature.mId = "Dedicated Player";
creatureRecordId = RecordHelper::createCreatureRecord(creature); creature.mId = creatureRecordId = RecordHelper::createCreatureRecord(creature);
LOG_APPEND(Log::LOG_INFO, "- Creating new creature record %s", creatureRecordId.c_str()); LOG_APPEND(Log::LOG_INFO, "- Creating new creature record %s", creatureRecordId.c_str());
} }
else
creature.mId = creatureRecordId; {
creature.mId = creatureRecordId;
RecordHelper::updateCreatureRecord(creature);
}
if (!reference) if (!reference)
{ {
LOG_APPEND(Log::LOG_INFO, "- Creating reference for %s", creature.mId.c_str());
createReference(creature.mId); createReference(creature.mId);
} }
else else
{ {
RecordHelper::updateCreatureRecord(creature);
reloadPtr(); reloadPtr();
} }
} }