From c4847918d5e673f4c780032592f6d5932de1a7a2 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Fri, 8 Apr 2022 17:22:45 +0300 Subject: [PATCH] [Client] Fix ObjectLock spam by sending only lock changes from scripts --- apps/openmw/mwscript/miscextensions.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwscript/miscextensions.cpp b/apps/openmw/mwscript/miscextensions.cpp index 199ff4ca6..d26c54ab6 100644 --- a/apps/openmw/mwscript/miscextensions.cpp +++ b/apps/openmw/mwscript/miscextensions.cpp @@ -423,9 +423,10 @@ namespace MWScript Start of tes3mp addition Send an ID_OBJECT_LOCK packet every time an object is locked - through a script + through a script, as long as the lock level being set is not + the one it already has */ - if (mwmp::Main::get().getLocalPlayer()->isLoggedIn()) + if (mwmp::Main::get().getLocalPlayer()->isLoggedIn() && ptr.getCellRef().getLockLevel() != lockLevel) { mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); @@ -471,9 +472,9 @@ namespace MWScript Start of tes3mp addition Send an ID_OBJECT_LOCK packet every time an object is unlocked - through a script + through a script, as long as it's not already unlocked */ - if (mwmp::Main::get().getLocalPlayer()->isLoggedIn()) + if (mwmp::Main::get().getLocalPlayer()->isLoggedIn() && ptr.getCellRef().getLockLevel() > 0) { mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset();