1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-28 21:15:34 +00:00

[Client] Fix assignAttackTarget() not assigning LocalPlayer as target

This commit is contained in:
David Cernat 2017-04-19 20:51:31 +03:00
parent 61cedfa192
commit 6c2bbd6608

View file

@ -59,7 +59,12 @@ Attack *MechanicsHelper::getDedicatedAttack(const MWWorld::Ptr& ptr)
void MechanicsHelper::assignAttackTarget(Attack* attack, const MWWorld::Ptr& target)
{
if (mwmp::PlayerList::isDedicatedPlayer(target))
if (target == MWBase::Environment::get().getWorld()->getPlayerPtr())
{
attack->target.guid = mwmp::Main::get().getLocalPlayer()->guid;
attack->target.refId.clear();
}
else if (mwmp::PlayerList::isDedicatedPlayer(target))
{
attack->target.guid = mwmp::PlayerList::getPlayer(target)->guid;
attack->target.refId.clear();