Almost fully fix Chasing Shadows (#2202)

This commit is contained in:
Nazrin 2023-06-10 20:31:57 -07:00 committed by GitHub
parent 9dbeb2172d
commit 2788206934
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 24 deletions

View File

@ -27,27 +27,6 @@ public class ExecNotifyGroupLua extends QuestExecHandler {
}
scene.runWhenFinished(
() -> {
val groupInstance = scriptManager.getGroupInstanceById(groupId);
if (groupInstance != null) {
// workaround to make sure the triggers are still there todo find better way of trigger
// handling
scriptManager.refreshGroup(groupInstance);
Grasscutter.getLogger()
.trace(
"group: {} \ncondition: {} \nparamStr {}",
groupInstance.getLuaGroup(),
condition,
paramStr);
} else {
Grasscutter.getLogger()
.debug(
"notify, no group instance for:\n group: {} \ncondition: {} \nparamStr {}",
groupId,
condition,
paramStr);
}
val eventType =
quest.getState() == QuestState.QUEST_STATE_FINISHED
? EventType.EVENT_QUEST_FINISH

View File

@ -32,9 +32,9 @@ public class SceneRegion {
public boolean contains(Position position) {
switch (shape) {
case ScriptRegionShape.CUBIC:
return (Math.abs(pos.getX() - position.getX()) <= size.getX())
&& (Math.abs(pos.getY() - position.getY()) <= size.getY())
&& (Math.abs(pos.getZ() - position.getZ()) <= size.getZ());
return (Math.abs(pos.getX() - position.getX()) <= size.getX() / 2f)
&& (Math.abs(pos.getY() - position.getY()) <= size.getY() / 2f)
&& (Math.abs(pos.getZ() - position.getZ()) <= size.getZ() / 2f);
case ScriptRegionShape.SPHERE:
var x = Math.pow(pos.getX() - position.getX(), 2);
var y = Math.pow(pos.getY() - position.getY(), 2);