From 691b332d0323cf33f63e8de01c326beb016b585a Mon Sep 17 00:00:00 2001 From: David Cernat Date: Thu, 5 Jul 2018 16:38:03 +0300 Subject: [PATCH] [Client] Use MechanicsHelper::getTarget() for summoners in ObjectList --- apps/openmw/mwmp/ObjectList.cpp | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/apps/openmw/mwmp/ObjectList.cpp b/apps/openmw/mwmp/ObjectList.cpp index 2da3e76fc..739f04eeb 100644 --- a/apps/openmw/mwmp/ObjectList.cpp +++ b/apps/openmw/mwmp/ObjectList.cpp @@ -859,26 +859,7 @@ void ObjectList::addObjectSpawn(const MWWorld::Ptr& ptr, const MWWorld::Ptr& mas baseObject.mpNum = 0; baseObject.isSummon = true; baseObject.summonDuration = duration; - - if (master == MWBase::Environment::get().getWorld()->getPlayerPtr()) - { - baseObject.master.isPlayer = true; - baseObject.master.guid = mwmp::Main::get().getLocalPlayer()->guid; - } - else if (mwmp::PlayerList::isDedicatedPlayer(master)) - { - baseObject.master.isPlayer = true; - baseObject.master.guid = mwmp::PlayerList::getPlayer(master)->guid; - } - else - { - MWWorld::CellRef *masterRef = &master.getCellRef(); - - baseObject.master.isPlayer = false; - baseObject.master.refId = masterRef->getRefId(); - baseObject.master.refNumIndex = masterRef->getRefNum().mIndex; - baseObject.master.mpNum = masterRef->getMpNum(); - } + baseObject.master = MechanicsHelper::getTarget(master); // Make sure we send the RefData position instead of the CellRef one, because that's what // we actually see on this client