Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Maple2.Model/Game/TriggerObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ public TriggerBox(Ms2TriggerBox metadata) {

public bool Contains(in Vector3 point) => box.Contains(point);

public bool Intersects(in IPrism shape) => box.Intersects(shape);

public override string ToString() {
return $"Id:{Id}\n- {box}";
}
Expand Down
2 changes: 1 addition & 1 deletion Maple2.Server.Game/Trigger/TriggerContext.Npc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ private IEnumerable<FieldNpc> NpcsInBox(params int[] boxIds) {
.Select(boxId => Objects.Boxes.GetValueOrDefault(boxId))
.Where(box => box != null)!;

return Field.EnumerateNpcs().Where(mob => boxes.Any(box => box.Contains(mob.Position)));
return Field.EnumerateNpcs().Where(mob => boxes.Any(box => box.Contains(mob.Position) || box.Intersects(mob.Shape)));
}

private void SpawnNpc(int spawnId, bool useSpawnAnimation = false) {
Expand Down
Loading