From 34e9f21cabdfe2af57bcad3e7e893e19cfee54e9 Mon Sep 17 00:00:00 2001 From: hartie95 Date: Sun, 11 Feb 2024 21:23:11 +0100 Subject: [PATCH] [Fix] Fixed parameter switchup in KillEntityByConfigId (thx @scooterboo ) --- .../gi_lua/models/scene/group/SceneGroup.java | 10 +++++----- .../gi_lua/script_lib/ScriptLib.java | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/GILua/src/main/java/org/anime_game_servers/gi_lua/models/scene/group/SceneGroup.java b/GILua/src/main/java/org/anime_game_servers/gi_lua/models/scene/group/SceneGroup.java index fea55f7..b64df6b 100644 --- a/GILua/src/main/java/org/anime_game_servers/gi_lua/models/scene/group/SceneGroup.java +++ b/GILua/src/main/java/org/anime_game_servers/gi_lua/models/scene/group/SceneGroup.java @@ -139,12 +139,12 @@ public class SceneGroup { this.suites = cs.getGlobalVariableList("suites", SceneSuite.class); this.regions = cs.getGlobalVariableList("regions", SceneRegion.class).stream() + .peek(group -> { + group.groupId = groupId; + group.blockId = blockId; + group.sceneMeta = sceneMeta; + }) .collect(Collectors.toMap(x -> x.configId, y -> y, (a, b) -> a)); - this.regions.values().forEach(m -> { - m.groupId = groupId; - m.blockId = blockId; - m.sceneMeta = sceneMeta; - }); this.initConfig = cs.getGlobalVariable("init_config", SceneInitConfig.class); diff --git a/GILua/src/main/java/org/anime_game_servers/gi_lua/script_lib/ScriptLib.java b/GILua/src/main/java/org/anime_game_servers/gi_lua/script_lib/ScriptLib.java index 681b65e..bac80f8 100644 --- a/GILua/src/main/java/org/anime_game_servers/gi_lua/script_lib/ScriptLib.java +++ b/GILua/src/main/java/org/anime_game_servers/gi_lua/script_lib/ScriptLib.java @@ -266,7 +266,7 @@ public class ScriptLib { return INVALID_PARAMETER.getValue(); } val entityType = EntityType.values()[entityTypeValue]; - val params = new KillByConfigIdParams(groupId, configId, entityType); + val params = new KillByConfigIdParams(configId, groupId, entityType); if (context instanceof GroupEventLuaContext gContext){ return gContext.getScriptLibHandlerProvider().getScriptLibHandler().KillEntityByConfigId(gContext, params); } else if (context instanceof ControllerLuaContext cContext) {