Skip to content
Merged
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
15 changes: 5 additions & 10 deletions Maple2.Server.Game/Trigger/TriggerContext.Field.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,16 +265,11 @@ public void SetPortal(int portalId, bool visible, bool enabled, bool minimapVisi
Broadcast(PortalPacket.Update(portal));
}

public void SetRandomMesh(int[] triggerIds, bool visible, int meshCount, int arg4, int delay) {
DebugLog("[SetRandomMesh] triggerIds:{Ids}, visible:{Visible}, meshCount:{MeshCount}, arg4:{Arg4}, delay:{Delay}",
string.Join(", ", triggerIds), visible, meshCount, arg4, delay);
int count = triggerIds.Length;
if (meshCount > 0 && meshCount < triggerIds.Length) {
count = meshCount;
Random.Shared.Shuffle(triggerIds);
}

UpdateMesh(new ArraySegment<int>(triggerIds, 0, count), visible, arg4, delay);
public void SetRandomMesh(int[] triggerIds, bool visible, int startDelay, int interval, int fade) {
DebugLog("[SetRandomMesh] triggerIds:{Ids}, visible:{Visible}, startDelay:{StartDelay}, interval:{Interval}, fade:{Fade}",
string.Join(", ", triggerIds), visible, startDelay, interval, fade);
Random.Shared.Shuffle(triggerIds);
UpdateMesh(triggerIds, visible, startDelay, interval, fade);
}

private void UpdateMesh(ArraySegment<int> triggerIds, bool visible, int delay, int interval, int fade = 0) {
Expand Down
Loading