mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-27 03:35:27 +00:00
Take Scale field in creature record into account (Fixes #2214)
This commit is contained in:
parent
79237d16a7
commit
4e0d16da8c
@ -897,4 +897,10 @@ namespace MWClass
|
|||||||
MWWorld::LiveCellRef<ESM::Creature> *ref = ptr.get<ESM::Creature>();
|
MWWorld::LiveCellRef<ESM::Creature> *ref = ptr.get<ESM::Creature>();
|
||||||
return ref->mBase->mAiData.mFight;
|
return ref->mBase->mAiData.mFight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Creature::adjustScale(const MWWorld::Ptr &ptr, float &scale) const
|
||||||
|
{
|
||||||
|
MWWorld::LiveCellRef<ESM::Creature> *ref = ptr.get<ESM::Creature>();
|
||||||
|
scale *= ref->mBase->mScale;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -156,6 +156,8 @@ namespace MWClass
|
|||||||
virtual void restock (const MWWorld::Ptr &ptr) const;
|
virtual void restock (const MWWorld::Ptr &ptr) const;
|
||||||
|
|
||||||
virtual int getBaseFightRating(const MWWorld::Ptr &ptr) const;
|
virtual int getBaseFightRating(const MWWorld::Ptr &ptr) const;
|
||||||
|
|
||||||
|
virtual void adjustScale(const MWWorld::Ptr& ptr,float& scale) const;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -754,8 +754,11 @@ namespace MWWorld
|
|||||||
|
|
||||||
if (OEngine::Physic::PhysicActor* act = mEngine->getCharacter(handle))
|
if (OEngine::Physic::PhysicActor* act = mEngine->getCharacter(handle))
|
||||||
{
|
{
|
||||||
// NOTE: Ignoring Npc::adjustScale (race height) on purpose. This is a bug in MW and must be replicated for compatibility reasons
|
float scale = ptr.getCellRef().getScale();
|
||||||
act->setScale(ptr.getCellRef().getScale());
|
if (!ptr.getClass().isNpc())
|
||||||
|
// NOTE: Ignoring Npc::adjustScale (race height) on purpose. This is a bug in MW and must be replicated for compatibility reasons
|
||||||
|
ptr.getClass().adjustScale(ptr, scale);
|
||||||
|
act->setScale(scale);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user