mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-27 15:11:36 -04:00
Send ID_OBJECT_ANIM_PLAY from ingame scripts
This commit is contained in:
parent
46397a7dac
commit
e414261121
@ -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…
x
Reference in New Issue
Block a user