forked from mirror/openmw-tes3mp
[Client] Improve synchronization of Actor swings
This commit is contained in:
parent
ce9605957a
commit
a4165325fa
1 changed files with 20 additions and 2 deletions
|
@ -210,6 +210,24 @@ namespace MWMechanics
|
||||||
storage.updateCombatMove(duration);
|
storage.updateCombatMove(duration);
|
||||||
if (storage.mReadyToAttack) updateActorsMovement(actor, duration, storage);
|
if (storage.mReadyToAttack) updateActorsMovement(actor, duration, storage);
|
||||||
storage.updateAttack(characterController);
|
storage.updateAttack(characterController);
|
||||||
|
|
||||||
|
/*
|
||||||
|
Start of tes3mp addition
|
||||||
|
|
||||||
|
Record that this actor is updating an attack so that a packet will be sent about it
|
||||||
|
*/
|
||||||
|
mwmp::Attack *localAttack = mwmp::Main::get().getMechanicsHelper()->getLocalAttack(actor);
|
||||||
|
|
||||||
|
if (localAttack && localAttack->pressed != storage.mAttack)
|
||||||
|
{
|
||||||
|
mwmp::Main::get().getMechanicsHelper()->resetAttack(localAttack);
|
||||||
|
localAttack->type = mwmp::Attack::MELEE;
|
||||||
|
localAttack->pressed = storage.mAttack;
|
||||||
|
localAttack->shouldSend = true;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
End of tes3mp addition
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -272,7 +290,7 @@ namespace MWMechanics
|
||||||
*/
|
*/
|
||||||
mwmp::Attack *localAttack = mwmp::Main::get().getMechanicsHelper()->getLocalAttack(actor);
|
mwmp::Attack *localAttack = mwmp::Main::get().getMechanicsHelper()->getLocalAttack(actor);
|
||||||
|
|
||||||
if (localAttack->pressed != false)
|
if (localAttack && localAttack->pressed != false)
|
||||||
{
|
{
|
||||||
mwmp::Main::get().getMechanicsHelper()->resetAttack(localAttack);
|
mwmp::Main::get().getMechanicsHelper()->resetAttack(localAttack);
|
||||||
localAttack->type = mwmp::Attack::MELEE;
|
localAttack->type = mwmp::Attack::MELEE;
|
||||||
|
@ -625,7 +643,7 @@ namespace MWMechanics
|
||||||
*/
|
*/
|
||||||
mwmp::Attack *localAttack = mwmp::Main::get().getMechanicsHelper()->getLocalAttack(actor);
|
mwmp::Attack *localAttack = mwmp::Main::get().getMechanicsHelper()->getLocalAttack(actor);
|
||||||
|
|
||||||
if (localAttack->pressed != true)
|
if (localAttack && localAttack->pressed != true)
|
||||||
{
|
{
|
||||||
mwmp::Main::get().getMechanicsHelper()->resetAttack(localAttack);
|
mwmp::Main::get().getMechanicsHelper()->resetAttack(localAttack);
|
||||||
localAttack->type = mwmp::Attack::MELEE;
|
localAttack->type = mwmp::Attack::MELEE;
|
||||||
|
|
Loading…
Reference in a new issue