forked from mirror/openmw-tes3mp
[Client] Ensure correct drawState when receiving an ActorAttack packet
This commit is contained in:
parent
bf2b3bbf51
commit
7c87ac80ee
2 changed files with 15 additions and 2 deletions
|
@ -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…
Reference in a new issue