mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-15 08:25:21 +01:00
Do not unload groups asked for by quests (#2212)
This commit is contained in:
@@ -25,6 +25,7 @@ public class ExecRefreshGroupSuite extends QuestExecHandler {
|
|||||||
if (!scriptManager.refreshGroupSuite(groupId, suiteId, quest)) {
|
if (!scriptManager.refreshGroupSuite(groupId, suiteId, quest)) {
|
||||||
result = false;
|
result = false;
|
||||||
}
|
}
|
||||||
|
scriptManager.getGroupById(groupId).dontUnload = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -838,7 +838,7 @@ public final class Scene {
|
|||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
|
|
||||||
for (var group : this.loadedGroups) {
|
for (var group : this.loadedGroups) {
|
||||||
if (!visible.contains(group.id) && !group.dynamic_load)
|
if (!visible.contains(group.id) && !group.dynamic_load && !group.dontUnload)
|
||||||
unloadGroup(scriptManager.getBlocks().get(group.block_id), group.id);
|
unloadGroup(scriptManager.getBlocks().get(group.block_id), group.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -266,7 +266,8 @@ public class SceneScriptManager {
|
|||||||
suiteId,
|
suiteId,
|
||||||
groupId,
|
groupId,
|
||||||
getScene().getId());
|
getScene().getId());
|
||||||
} else {
|
if (targetGroupInstance == null) return false;
|
||||||
|
}
|
||||||
Grasscutter.getLogger().debug("Refreshing group {} suite {}", groupId, suiteId);
|
Grasscutter.getLogger().debug("Refreshing group {} suite {}", groupId, suiteId);
|
||||||
suiteId =
|
suiteId =
|
||||||
refreshGroup(
|
refreshGroup(
|
||||||
@@ -274,7 +275,6 @@ public class SceneScriptManager {
|
|||||||
suiteId,
|
suiteId,
|
||||||
false); // If suiteId is zero, the value of suiteId changes
|
false); // If suiteId is zero, the value of suiteId changes
|
||||||
scene.broadcastPacket(new PacketGroupSuiteNotify(groupId, suiteId));
|
scene.broadcastPacket(new PacketGroupSuiteNotify(groupId, suiteId));
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ public final class SceneGroup {
|
|||||||
public SceneGarbage garbages;
|
public SceneGarbage garbages;
|
||||||
public SceneInitConfig init_config;
|
public SceneInitConfig init_config;
|
||||||
@Getter public boolean dynamic_load = false;
|
@Getter public boolean dynamic_load = false;
|
||||||
|
public boolean dontUnload = false;
|
||||||
|
|
||||||
public SceneReplaceable is_replaceable;
|
public SceneReplaceable is_replaceable;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user