public void OnBanchoMatchChangeSlot(BanchoMatchChangeSlotArgs args) { if (args.pr.JoinedRoom == null) { return; } if (args.SlotId > 16) { return; } var newSlot = args.pr.JoinedRoom.Slots[args.SlotId]; if (newSlot.UserId != -1) { return; } var oldSlot = args.pr.JoinedRoom.GetSlotByUserId(args.pr.User.Id); args.pr.JoinedRoom.SetSlot(newSlot, oldSlot); args.pr.JoinedRoom.ClearSlot(oldSlot); }
public void OnBanchoMatchChangeSlot(BanchoMatchChangeSlotArgs args) { var match = args.Pr.ActiveMatch; if (match == null || args.SlotId > 16) { return; } var newSlot = match.Slots[args.SlotId]; if (newSlot.UserId != -1) { return; } var oldSlot = match.GetSlotByUserId(args.Pr.User.Id); match.SetSlot(newSlot, oldSlot); match.ClearSlot(oldSlot); match.Update(); }