From e4142611216b00806bd8c876426a44047e8d50d9 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Thu, 27 Oct 2016 16:46:47 +0300 Subject: [PATCH] Send ID_OBJECT_ANIM_PLAY from ingame scripts --- apps/openmw/mwscript/animationextensions.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/apps/openmw/mwscript/animationextensions.cpp b/apps/openmw/mwscript/animationextensions.cpp index 347bbca56..3a800bed6 100644 --- a/apps/openmw/mwscript/animationextensions.cpp +++ b/apps/openmw/mwscript/animationextensions.cpp @@ -3,6 +3,10 @@ #include #include +#include +#include "../mwmp/Main.hpp" +#include "../mwworld/cellstore.hpp" + #include #include @@ -56,6 +60,15 @@ namespace MWScript throw std::runtime_error ("animation mode out of range"); } + // Added by tes3mp + mwmp::WorldEvent *event = mwmp::Main::get().getNetworking()->createWorldEvent(); + event->cell = *ptr.getCell()->getCell(); + event->cellRef.mRefID = ptr.getCellRef().getRefId(); + event->cellRef.mRefNum = ptr.getCellRef().getRefNum(); + event->animGroup = group; + event->animMode = mode; + mwmp::Main::get().getNetworking()->GetWorldPacket(ID_OBJECT_ANIM_PLAY)->Send(event); + MWBase::Environment::get().getMechanicsManager()->playAnimationGroup (ptr, group, mode, std::numeric_limits::max(), true); } };