diff --git a/apps/openmw/mwclass/container.cpp b/apps/openmw/mwclass/container.cpp index d23b8aa6c..0d68e3676 100644 --- a/apps/openmw/mwclass/container.cpp +++ b/apps/openmw/mwclass/container.cpp @@ -209,6 +209,7 @@ namespace MWClass */ mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY; objectList->addObjectTrap(ptr, ptr.getRefData().getPosition(), true); objectList->sendObjectTrap(); /* @@ -225,6 +226,7 @@ namespace MWClass { mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY; objectList->addObjectLock(ptr, 0); objectList->sendObjectLock(); } diff --git a/apps/openmw/mwclass/door.cpp b/apps/openmw/mwclass/door.cpp index ecfdaf7d8..8decf9acf 100644 --- a/apps/openmw/mwclass/door.cpp +++ b/apps/openmw/mwclass/door.cpp @@ -208,6 +208,7 @@ namespace MWClass */ mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY; objectList->addObjectTrap(ptr, ptr.getRefData().getPosition(), true); objectList->sendObjectTrap(); /* @@ -224,6 +225,7 @@ namespace MWClass { mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY; objectList->addObjectLock(ptr, 0); objectList->sendObjectLock(); } diff --git a/apps/openmw/mwgui/container.cpp b/apps/openmw/mwgui/container.cpp index d4b930545..b69660074 100644 --- a/apps/openmw/mwgui/container.cpp +++ b/apps/openmw/mwgui/container.cpp @@ -114,6 +114,7 @@ namespace MWGui */ mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY; objectList->cell = *mPtr.getCell()->getCell(); objectList->action = mwmp::BaseObjectList::REMOVE; objectList->containerSubAction = mwmp::BaseObjectList::DRAG; @@ -158,6 +159,7 @@ namespace MWGui { mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY; objectList->cell = *mPtr.getCell()->getCell(); objectList->action = mwmp::BaseObjectList::ADD; objectList->containerSubAction = mwmp::BaseObjectList::DROP; @@ -296,6 +298,7 @@ namespace MWGui */ mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY; objectList->cell = *mPtr.getCell()->getCell(); objectList->action = mwmp::BaseObjectList::REMOVE; objectList->containerSubAction = mwmp::BaseObjectList::TAKE_ALL; @@ -379,6 +382,7 @@ namespace MWGui { mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY; objectList->addObjectDelete(mPtr); objectList->sendObjectDelete(); } diff --git a/apps/openmw/mwgui/hud.cpp b/apps/openmw/mwgui/hud.cpp index a785a5f37..368aaf9ea 100644 --- a/apps/openmw/mwgui/hud.cpp +++ b/apps/openmw/mwgui/hud.cpp @@ -74,6 +74,7 @@ namespace MWGui */ mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY; objectList->addObjectPlace(dropped, true); objectList->sendObjectPlace(); /* diff --git a/apps/openmw/mwgui/inventorywindow.cpp b/apps/openmw/mwgui/inventorywindow.cpp index 66bbec76a..f6423cf35 100644 --- a/apps/openmw/mwgui/inventorywindow.cpp +++ b/apps/openmw/mwgui/inventorywindow.cpp @@ -709,6 +709,7 @@ namespace MWGui */ mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY; objectList->addObjectDelete(object); objectList->sendObjectDelete(); mwmp::Main::get().getLocalPlayer()->sendInventory(); diff --git a/apps/openmw/mwmechanics/actors.cpp b/apps/openmw/mwmechanics/actors.cpp index 036c7bf21..143eb382a 100644 --- a/apps/openmw/mwmechanics/actors.cpp +++ b/apps/openmw/mwmechanics/actors.cpp @@ -1816,6 +1816,7 @@ namespace MWMechanics */ mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY; objectList->addObjectDelete(ptr); objectList->sendObjectDelete(); /* diff --git a/apps/openmw/mwmechanics/aiactivate.cpp b/apps/openmw/mwmechanics/aiactivate.cpp index 1d4602a6f..7e50b1229 100644 --- a/apps/openmw/mwmechanics/aiactivate.cpp +++ b/apps/openmw/mwmechanics/aiactivate.cpp @@ -94,6 +94,7 @@ namespace MWMechanics */ mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY; objectList->addObjectActivate(target, actor); objectList->sendObjectActivate(); /* diff --git a/apps/openmw/mwmechanics/security.cpp b/apps/openmw/mwmechanics/security.cpp index d37a07e33..84f8e0f45 100644 --- a/apps/openmw/mwmechanics/security.cpp +++ b/apps/openmw/mwmechanics/security.cpp @@ -86,6 +86,7 @@ namespace MWMechanics */ mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY; objectList->addObjectLock(lock, 0); objectList->sendObjectLock(); /* @@ -154,6 +155,7 @@ namespace MWMechanics */ mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY; objectList->addObjectTrap(trap, trap.getRefData().getPosition(), true); objectList->sendObjectTrap(); /* diff --git a/apps/openmw/mwmechanics/spellcasting.cpp b/apps/openmw/mwmechanics/spellcasting.cpp index 615c745e0..efa3cf58b 100644 --- a/apps/openmw/mwmechanics/spellcasting.cpp +++ b/apps/openmw/mwmechanics/spellcasting.cpp @@ -712,6 +712,7 @@ namespace MWMechanics */ mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY; objectList->addObjectLock(target, static_cast(magnitude)); objectList->sendObjectLock(); /* @@ -758,6 +759,7 @@ namespace MWMechanics */ mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY; objectList->addObjectLock(target, 0); objectList->sendObjectLock(); /* @@ -939,7 +941,7 @@ namespace MWMechanics /* Start of tes3mp addition - If this mPtr belongs to a LocalPlayer or LocalActor, get their Attack and prepare + If this mCaster belongs to a LocalPlayer or LocalActor, get their Attack and prepare it for sending */ mwmp::Attack *localAttack = MechanicsHelper::getLocalAttack(mCaster); diff --git a/apps/openmw/mwmechanics/summoning.cpp b/apps/openmw/mwmechanics/summoning.cpp index 094f91a9a..fcf0826ce 100644 --- a/apps/openmw/mwmechanics/summoning.cpp +++ b/apps/openmw/mwmechanics/summoning.cpp @@ -108,6 +108,7 @@ namespace MWMechanics { mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY; MWMechanics::CreatureStats *actorCreatureStats = &mActor.getClass().getCreatureStats(mActor); @@ -168,6 +169,7 @@ namespace MWMechanics */ mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY; objectList->addObjectDelete(ptr); objectList->sendObjectDelete(); /* diff --git a/apps/openmw/mwmp/MechanicsHelper.cpp b/apps/openmw/mwmp/MechanicsHelper.cpp index 89aaf0fc7..29efe858d 100644 --- a/apps/openmw/mwmp/MechanicsHelper.cpp +++ b/apps/openmw/mwmp/MechanicsHelper.cpp @@ -37,6 +37,7 @@ void MechanicsHelper::spawnLeveledCreatures(MWWorld::CellStore* cellStore) MWWorld::CellRefList *creatureLevList = cellStore->getCreatureLists(); mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY; int spawnCount = 0; diff --git a/apps/openmw/mwscript/animationextensions.cpp b/apps/openmw/mwscript/animationextensions.cpp index bf7dd9957..9e8ea801a 100644 --- a/apps/openmw/mwscript/animationextensions.cpp +++ b/apps/openmw/mwscript/animationextensions.cpp @@ -11,6 +11,7 @@ #include "../mwmp/Main.hpp" #include "../mwmp/Networking.hpp" #include "../mwmp/ObjectList.hpp" +#include "../mwmp/ScriptController.hpp" /* End of tes3mp addition */ @@ -84,6 +85,7 @@ namespace MWScript { mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(runtime.getContext().getContextType()); objectList->addObjectAnimPlay(ptr, group, mode); objectList->sendObjectAnimPlay(); } diff --git a/apps/openmw/mwscript/containerextensions.cpp b/apps/openmw/mwscript/containerextensions.cpp index 539fd28cc..fb9c523f9 100644 --- a/apps/openmw/mwscript/containerextensions.cpp +++ b/apps/openmw/mwscript/containerextensions.cpp @@ -16,6 +16,7 @@ #include "../mwmp/LocalPlayer.hpp" #include "../mwmp/PlayerList.hpp" #include "../mwmp/ObjectList.hpp" +#include "../mwmp/ScriptController.hpp" /* End of tes3mp addition */ @@ -127,6 +128,7 @@ namespace MWScript { mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(runtime.getContext().getContextType()); objectList->cell = *ptr.getCell()->getCell(); objectList->action = mwmp::BaseObjectList::ADD; objectList->containerSubAction = mwmp::BaseObjectList::NONE; @@ -253,6 +255,7 @@ namespace MWScript { mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(runtime.getContext().getContextType()); objectList->cell = *ptr.getCell()->getCell(); objectList->action = mwmp::BaseObjectList::REMOVE; objectList->containerSubAction = mwmp::BaseObjectList::NONE; diff --git a/apps/openmw/mwscript/interpretercontext.cpp b/apps/openmw/mwscript/interpretercontext.cpp index f26ecec15..fd0fdbb60 100644 --- a/apps/openmw/mwscript/interpretercontext.cpp +++ b/apps/openmw/mwscript/interpretercontext.cpp @@ -20,6 +20,7 @@ #include "../mwmp/Networking.hpp" #include "../mwmp/LocalPlayer.hpp" #include "../mwmp/ObjectList.hpp" +#include "../mwmp/ScriptController.hpp" /* End of tes3mp addition */ @@ -231,6 +232,7 @@ namespace MWScript { mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(getContextType()); objectList->addScriptLocalShort(mReference, index, value); objectList->sendScriptLocalShort(); } @@ -265,6 +267,7 @@ namespace MWScript { mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(getContextType()); objectList->addScriptLocalFloat(mReference, index, value); objectList->sendScriptLocalFloat(); } @@ -328,6 +331,7 @@ namespace MWScript { mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(getContextType()); objectList->addScriptGlobalShort(name, value); objectList->sendScriptGlobalShort(); } @@ -618,6 +622,7 @@ namespace MWScript { mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(getContextType()); objectList->addObjectState(ref, true); objectList->sendObjectState(); } @@ -655,6 +660,7 @@ namespace MWScript { mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(getContextType()); objectList->addObjectState(ref, false); objectList->sendObjectState(); } @@ -734,6 +740,7 @@ namespace MWScript { mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(getContextType()); objectList->addScriptMemberShort(id, index, value); objectList->sendScriptMemberShort(); } diff --git a/apps/openmw/mwscript/miscextensions.cpp b/apps/openmw/mwscript/miscextensions.cpp index f51ca9461..adb25a5a2 100644 --- a/apps/openmw/mwscript/miscextensions.cpp +++ b/apps/openmw/mwscript/miscextensions.cpp @@ -10,6 +10,7 @@ #include "../mwmp/Main.hpp" #include "../mwmp/Networking.hpp" #include "../mwmp/ObjectList.hpp" +#include "../mwmp/ScriptController.hpp" /* End of tes3mp addition */ @@ -106,6 +107,7 @@ namespace MWScript */ mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(runtime.getContext().getContextType()); objectList->addVideoPlay(name, allowSkipping); objectList->sendVideoPlay(); /* @@ -216,6 +218,7 @@ namespace MWScript */ mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(runtime.getContext().getContextType()); objectList->addObjectLock(ptr, lockLevel); objectList->sendObjectLock(); /* @@ -265,6 +268,7 @@ namespace MWScript */ mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(runtime.getContext().getContextType()); objectList->addObjectLock(ptr, 0); objectList->sendObjectLock(); /* @@ -768,6 +772,7 @@ namespace MWScript */ mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(runtime.getContext().getContextType()); objectList->addObjectDelete(ptr); objectList->sendObjectDelete(); /* diff --git a/apps/openmw/mwscript/soundextensions.cpp b/apps/openmw/mwscript/soundextensions.cpp index 47016fdb0..784dbd933 100644 --- a/apps/openmw/mwscript/soundextensions.cpp +++ b/apps/openmw/mwscript/soundextensions.cpp @@ -8,6 +8,7 @@ #include "../mwmp/Main.hpp" #include "../mwmp/Networking.hpp" #include "../mwmp/ObjectList.hpp" +#include "../mwmp/ScriptController.hpp" /* End of tes3mp addition */ @@ -89,6 +90,7 @@ namespace MWScript */ mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(runtime.getContext().getContextType()); objectList->addMusicPlay(sound); objectList->sendMusicPlay(); /* diff --git a/apps/openmw/mwscript/transformationextensions.cpp b/apps/openmw/mwscript/transformationextensions.cpp index 543f59b02..8f3dca009 100644 --- a/apps/openmw/mwscript/transformationextensions.cpp +++ b/apps/openmw/mwscript/transformationextensions.cpp @@ -12,6 +12,7 @@ #include "../mwmp/LocalPlayer.hpp" #include "../mwmp/PlayerList.hpp" #include "../mwmp/ObjectList.hpp" +#include "../mwmp/ScriptController.hpp" /* End of tes3mp addition */ @@ -82,6 +83,7 @@ namespace MWScript { mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(runtime.getContext().getContextType()); objectList->addObjectScale(ptr, scale); objectList->sendObjectScale(); } @@ -599,6 +601,7 @@ namespace MWScript */ mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(runtime.getContext().getContextType()); if (ptr.getClass().isActor()) { diff --git a/apps/openmw/mwworld/actiontake.cpp b/apps/openmw/mwworld/actiontake.cpp index c8742aa7b..aa3b41d38 100644 --- a/apps/openmw/mwworld/actiontake.cpp +++ b/apps/openmw/mwworld/actiontake.cpp @@ -42,6 +42,7 @@ namespace MWWorld */ mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY; objectList->addObjectDelete(getTarget()); objectList->sendObjectDelete(); mwmp::Main::get().getLocalPlayer()->sendInventory(); diff --git a/apps/openmw/mwworld/actiontrap.cpp b/apps/openmw/mwworld/actiontrap.cpp index cf5a725bf..f80a6b84e 100644 --- a/apps/openmw/mwworld/actiontrap.cpp +++ b/apps/openmw/mwworld/actiontrap.cpp @@ -60,6 +60,7 @@ namespace MWWorld */ mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY; ESM::Position pos; diff --git a/apps/openmw/mwworld/player.cpp b/apps/openmw/mwworld/player.cpp index 7220464ef..eb3931383 100644 --- a/apps/openmw/mwworld/player.cpp +++ b/apps/openmw/mwworld/player.cpp @@ -261,6 +261,7 @@ namespace MWWorld */ mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY; objectList->addObjectActivate(toActivate, player); objectList->sendObjectActivate(); /* diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 95fe12371..e07eac619 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -2579,6 +2579,7 @@ namespace MWWorld */ mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY; objectList->addDoorState(door, state); objectList->sendDoorState(); /* @@ -2598,6 +2599,7 @@ namespace MWWorld */ mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY; objectList->addDoorState(door, state); objectList->sendDoorState(); /* @@ -3676,6 +3678,7 @@ namespace MWWorld mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); + objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY; objectList->addObjectSpawn(ptr); objectList->sendObjectSpawn();