From 4ec274f5c57f572618e97b30fbe9b262c8f2b2ca Mon Sep 17 00:00:00 2001 From: Nazrin Date: Sun, 25 Jun 2023 07:45:37 -0700 Subject: [PATCH] Set event source for group variable changes to the variable name (#2231) --- src/main/java/emu/grasscutter/scripts/ScriptLib.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/emu/grasscutter/scripts/ScriptLib.java b/src/main/java/emu/grasscutter/scripts/ScriptLib.java index e6f9b3921..f967d3101 100644 --- a/src/main/java/emu/grasscutter/scripts/ScriptLib.java +++ b/src/main/java/emu/grasscutter/scripts/ScriptLib.java @@ -403,7 +403,7 @@ public class ScriptLib { val old = variables.getOrDefault(var, value); variables.put(var, value); - getSceneScriptManager().callEvent(new ScriptArgs(groupId, EventType.EVENT_VARIABLE_CHANGE, value, old)); + getSceneScriptManager().callEvent(new ScriptArgs(groupId, EventType.EVENT_VARIABLE_CHANGE, value, old).setEventSource(var)); return 0; } @@ -418,7 +418,7 @@ public class ScriptLib { variables.put(var, old + value); logger.debug("[LUA] Call ChangeGroupVariableValue with {},{}", old, old+value); - getSceneScriptManager().callEvent(new ScriptArgs(groupId, EventType.EVENT_VARIABLE_CHANGE, old+value, old)); + getSceneScriptManager().callEvent(new ScriptArgs(groupId, EventType.EVENT_VARIABLE_CHANGE, old+value, old).setEventSource(var)); return LuaValue.ZERO; }