handle updating player not on list
This commit is contained in:
parent
6bcf9eda0c
commit
aef5984d70
@ -4392,9 +4392,6 @@ class GUI(QtGui.QWidget):
|
||||
self.boxEvidence.setCurrentIndex(self.selectedEvidence)
|
||||
|
||||
def updatePlayerList(self, pid, op, utype, data=""):
|
||||
# if not self.playerList:
|
||||
# return
|
||||
|
||||
pid = str(pid)
|
||||
if op == 0: # Add or remove player
|
||||
if utype == 0: # Add a player
|
||||
@ -4416,6 +4413,10 @@ class GUI(QtGui.QWidget):
|
||||
_dataInt, ok = data.toInt()
|
||||
_data = self.charList[int(_dataInt)][0] if ok else decodeAOString(data)
|
||||
self.playerList[pid][utype] = _data
|
||||
else:
|
||||
# If for some reason the player is not in the list, handle it
|
||||
self.playerItems.addItem("[%s]" % pid)
|
||||
self.playerList[pid] = ["", "", "", ""]
|
||||
|
||||
item = self.playerItems.findItems("[%s]" % pid, QtCore.Qt.MatchStartsWith)
|
||||
if item:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user