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; }