[Client] Ensure correct drawState when receiving an ActorAttack packet

0.6.1
David Cernat 8 years ago
parent bf2b3bbf51
commit 7c87ac80ee

@ -251,6 +251,20 @@ void Cell::readAttack(ActorList& actorList)
{
DedicatedActor *actor = dedicatedActors[mapIndex];
actor->attack = baseActor.attack;
// Set the correct drawState here if we've somehow we've missed a previous
// AnimFlags packet
if (actor->attack.type == mwmp::Attack::MELEE && actor->drawState != 1)
{
actor->drawState = 1;
actor->setAnimFlags();
}
else if (actor->attack.type == mwmp::Attack::MAGIC && actor->drawState != 2)
{
actor->drawState = 2;
actor->setAnimFlags();
}
mwmp::Main::get().getMechanicsHelper()->processAttack(actor->attack, actor->getPtr());
}
}

@ -173,9 +173,8 @@ void MechanicsHelper::processAttack(Attack attack, const MWWorld::Ptr& attacker)
}
}
// Get the weapon used (if hand-to-hand, weapon = inv.end())
if (attackerStats.getDrawState() == MWMechanics::DrawState_Weapon)
if (attack.type == attack.MELEE)
{
MWWorld::Ptr weapon;

Loading…
Cancel
Save