[Client] Prevent errors from NPC-only packets for DedicatedPlayers

0.6.3
David Cernat 7 years ago
parent 68ee64902d
commit 716809f2db

@ -276,6 +276,9 @@ void DedicatedPlayer::setAnimFlags()
void DedicatedPlayer::setEquipment() void DedicatedPlayer::setEquipment()
{ {
// Go no further if the player is disguised as a creature
if (!ptr.getClass().hasInventoryStore(ptr)) return;
MWWorld::InventoryStore& invStore = ptr.getClass().getInventoryStore(ptr); MWWorld::InventoryStore& invStore = ptr.getClass().getInventoryStore(ptr);
for (int slot = 0; slot < MWWorld::InventoryStore::Slots; ++slot) for (int slot = 0; slot < MWWorld::InventoryStore::Slots; ++slot)
{ {

@ -30,6 +30,10 @@ namespace mwmp
else if (player != 0) else if (player != 0)
{ {
MWWorld::Ptr ptrPlayer = static_cast<DedicatedPlayer *>(player)->getPtr(); MWWorld::Ptr ptrPlayer = static_cast<DedicatedPlayer *>(player)->getPtr();
// Go no further if the player is disguised as a creature
if (ptrPlayer.getTypeName() != typeid(ESM::NPC).name()) return;
MWMechanics::NpcStats *ptrNpcStats = &ptrPlayer.getClass().getNpcStats(ptrPlayer); MWMechanics::NpcStats *ptrNpcStats = &ptrPlayer.getClass().getNpcStats(ptrPlayer);
MWMechanics::SkillValue skillValue; MWMechanics::SkillValue skillValue;

Loading…
Cancel
Save