forked from mirror/openmw-tes3mp
Send ID_OBJECT_ANIM_PLAY from ingame scripts
This commit is contained in:
parent
46397a7dac
commit
e414261121
1 changed files with 13 additions and 0 deletions
|
@ -3,6 +3,10 @@
|
|||
#include <stdexcept>
|
||||
#include <limits>
|
||||
|
||||
#include <components/openmw-mp/Base/WorldEvent.hpp>
|
||||
#include "../mwmp/Main.hpp"
|
||||
#include "../mwworld/cellstore.hpp"
|
||||
|
||||
#include <components/compiler/extensions.hpp>
|
||||
#include <components/compiler/opcodes.hpp>
|
||||
|
||||
|
@ -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<int>::max(), true);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue