From 0bef4d64ddd777c973906a5fa6812a92f0b81765 Mon Sep 17 00:00:00 2001 From: Daz Date: Sat, 23 Mar 2024 13:47:28 +0100 Subject: [PATCH] Events: fix `NWNX_ON_MATERIALCHANGE_` excessively firing when using WASD --- Plugins/Events/Events/MovementEvents.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Events/Events/MovementEvents.cpp b/Plugins/Events/Events/MovementEvents.cpp index 3b1815241f0..2a648244fde 100644 --- a/Plugins/Events/Events/MovementEvents.cpp +++ b/Plugins/Events/Events/MovementEvents.cpp @@ -70,7 +70,7 @@ void SetPositionMaterialChangeHook(CNWSObject* thisPtr, Vector vPosition, BOOL b int32_t oldMaterial = pArea->GetSurfaceMaterial(pCreature->m_vPosition); int32_t newMaterial = pArea->GetSurfaceMaterial(vPosition); - if (oldMaterial != newMaterial || pCreature->m_vPosition == vPosition) + if (oldMaterial != newMaterial) { PushEventData("MATERIAL_TYPE", std::to_string(newMaterial)); SignalEvent("NWNX_ON_MATERIALCHANGE_BEFORE", thisPtr->m_idSelf);