mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-22 07:37:43 +00:00
Set event source for group variable changes to the variable name (#2231)
This commit is contained in:
parent
30d093f348
commit
4ec274f5c5
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user