forked from mirror/openmw-tes3mp
Don't send animation packets from blacklisted scripts
This commit is contained in:
parent
e414261121
commit
7f98cddfdf
2 changed files with 13 additions and 9 deletions
apps/openmw
|
@ -78,7 +78,7 @@ void OMW::Engine::executeLocalScripts()
|
|||
MWScript::InterpreterContext interpreterContext (
|
||||
&script.second.getRefData().getLocals(), script.second);
|
||||
|
||||
// Added by tes3mp
|
||||
// Added by tes3mp to check and set whether packets should be sent about this script
|
||||
if (mwmp::Main::isValidPacketScript(script.first))
|
||||
{
|
||||
interpreterContext.sendPackets = true;
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#include <components/openmw-mp/Base/WorldEvent.hpp>
|
||||
#include "../mwmp/Main.hpp"
|
||||
#include "../mwworld/cellstore.hpp"
|
||||
#include "../mwworld/class.hpp"
|
||||
|
||||
#include <components/compiler/extensions.hpp>
|
||||
#include <components/compiler/opcodes.hpp>
|
||||
|
@ -60,14 +61,17 @@ 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);
|
||||
// Added by tes3mp to check and set whether packets should be sent about this script
|
||||
if (mwmp::Main::isValidPacketScript(ptr.getClass().getScript(ptr)))
|
||||
{
|
||||
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