forked from teamnwah/openmw-tes3coop
[Client] Always create new references for new creature disguises
Previously, attempts to reuse the same reference for multiple creature disguises led to movement animation issues, as well as a dynamic_cast error in Creature::getInventoryStore() that made a DedicatedPlayer vanish completely when they first lost their creature disguise, then disguised themselves as a creature that could not hold weapons and then disguised themselves as a creature that could hold weapons.
This commit is contained in:
parent
60bc7447d9
commit
f52364e05c
1 changed files with 3 additions and 13 deletions
|
@ -186,10 +186,7 @@ void DedicatedPlayer::setShapeshift()
|
|||
{
|
||||
if (!creatureRefId.empty() && RecordHelper::doesCreatureExist(creatureRefId))
|
||||
{
|
||||
if (isNpc)
|
||||
{
|
||||
deleteReference();
|
||||
}
|
||||
deleteReference();
|
||||
|
||||
const ESM::Creature *tmpCreature = world->getStore().get<ESM::Creature>().search(creatureRefId);
|
||||
creature = *tmpCreature;
|
||||
|
@ -211,15 +208,8 @@ void DedicatedPlayer::setShapeshift()
|
|||
RecordHelper::overrideCreatureRecord(creature);
|
||||
}
|
||||
|
||||
if (!reference)
|
||||
{
|
||||
LOG_APPEND(Log::LOG_INFO, "- Creating reference for %s", creature.mId.c_str());
|
||||
createReference(creature.mId);
|
||||
}
|
||||
else
|
||||
{
|
||||
reloadPtr();
|
||||
}
|
||||
LOG_APPEND(Log::LOG_INFO, "- Creating reference for %s", creature.mId.c_str());
|
||||
createReference(creature.mId);
|
||||
}
|
||||
// This player was already a creature, but the new creature refId was empty or
|
||||
// invalid, so we'll turn this player into their NPC self again as a result
|
||||
|
|
Loading…
Reference in a new issue