Bom,o bug ocorre quando mais de 2 jogadores estão em um mesmo grupo e um deles resolve sair,teste ai mesmo.
Para arrumar,vá no servidor,e procure por "Sub Party_PlayerLeave"
Troque tudo por:
Pronto,agora o sistema de grupo funcionará normalmente.
Para arrumar,vá no servidor,e procure por "Sub Party_PlayerLeave"
Troque tudo por:
- Código:
Public Sub Party_PlayerLeave(ByVal index As Long)
Dim partyNum As Long, i As Long
partyNum = TempPlayer(index).inParty
If partyNum > 0 Then
' find out how many members we have
Party_CountMembers partyNum
' make sure there's more than 2 people
If Party(partyNum).MemberCount > 2 Then
' check if leader
If Party(partyNum).Leader = index Then
' set next person down as leader
For i = 1 To MAX_PARTY_MEMBERS
If Party(partyNum).Member(i) > 0 And Party(partyNum).Member(i) <> index Then
Party(partyNum).Leader = Party(partyNum).Member(i)
PartyMsg partyNum, GetPlayerName(i) & " é o lider do grupo.", BrightBlue
Exit For
End If
Next
' leave party
PartyMsg partyNum, GetPlayerName(index) & " saiu do grupo.", BrightRed
' remove from array
For i = 1 To MAX_PARTY_MEMBERS
If Party(partyNum).Member(i) = index Then
Party(partyNum).Member(i) = 0
TempPlayer(index).inParty = 0
TempPlayer(index).partyInvite = 0
Exit For
End If
Next
' recount party
Party_CountMembers partyNum
' set update to all
SendPartyUpdate partyNum
' send clear to player
SendPartyUpdateTo index
Else
' not the leader, just leave
PartyMsg partyNum, GetPlayerName(index) & " saiu do grupo.", BrightRed
' remove from array
For i = 1 To MAX_PARTY_MEMBERS
If Party(partyNum).Member(i) = index Then
Party(partyNum).Member(i) = 0
TempPlayer(index).inParty = 0
TempPlayer(index).partyInvite = 0
Exit For
End If
Next
' recount party
Party_CountMembers partyNum
' set update to all
SendPartyUpdate partyNum
' send clear to player
SendPartyUpdateTo index
End If
Else
' find out how many members we have
Party_CountMembers partyNum
' only 2 people, disband
PartyMsg partyNum, "Grupo desfeito.", BrightRed
' clear out everyone's party
For i = 1 To MAX_PARTY_MEMBERS
index = Party(partyNum).Member(i)
' player exist?
If index > 0 Then
' remove them
TempPlayer(index).partyInvite = 0
TempPlayer(index).inParty = 0
' send clear to players
SendPartyUpdateTo index
End If
Next
' clear out the party itself
ClearParty partyNum
End If
End If
End Sub
Pronto,agora o sistema de grupo funcionará normalmente.