guard against empty OTHER_OFFSET
This commit is contained in:
parent
679a8688ce
commit
6bcf9eda0c
31
gameview.py
31
gameview.py
@ -1,7 +1,3 @@
|
||||
# This is the main file where everything happens. Honestly, it sucks and the
|
||||
# thing is so complex and unsafe that I'm surprised it even works. I wish for
|
||||
# a simpler client. ~ cidoku
|
||||
|
||||
import thread, time, os, urllib, random, platform, subprocess
|
||||
from os.path import exists, basename
|
||||
from collections import OrderedDict
|
||||
@ -984,6 +980,13 @@ class GUI(QtGui.QWidget):
|
||||
self.slideBgAnimation.finished.connect(self.slideDone)
|
||||
self.slideBgAnimation.valueChanged.connect(self.slideChanged)
|
||||
self.slideBg.hide()
|
||||
|
||||
self.onscreenTimerLabels = []
|
||||
self.onscreenTimerTimes = [0, 0, 0, 0, 0]
|
||||
self.onscreenTimerPaused = [True, True, True, True, True]
|
||||
self.onscreenTimer = QtCore.QTimer(self)
|
||||
self.onscreenTimer.timeout.connect(self.updateOnscreenTimers)
|
||||
self.onscreenTimerTick = 1000
|
||||
|
||||
self.zoom = ZoomLines(self.viewport)
|
||||
|
||||
@ -1052,13 +1055,6 @@ class GUI(QtGui.QWidget):
|
||||
self.screenshake.timeout.connect(self.screenShakeTick)
|
||||
self.shakesRemaining = 0
|
||||
|
||||
self.onscreenTimerLabels = []
|
||||
self.onscreenTimerTimes = [0, 0, 0, 0, 0]
|
||||
self.onscreenTimerPaused = [True, True, True, True, True]
|
||||
self.onscreenTimer = QtCore.QTimer(self)
|
||||
self.onscreenTimer.timeout.connect(self.updateOnscreenTimers)
|
||||
self.onscreenTimerTick = 1000
|
||||
|
||||
for i in range(len(self.onscreenTimerTimes)):
|
||||
label = QtGui.QLabel(self.viewport)
|
||||
label.hide()
|
||||
@ -3710,12 +3706,13 @@ class GUI(QtGui.QWidget):
|
||||
boxPairOrder = -1
|
||||
|
||||
hor2_offset = vert2_offset = 0
|
||||
if "y_offset" in self.features: # AO 2.9
|
||||
keyword = "<and>" if "<and>" in self.mChatMessage[OTHER_OFFSET] else "&" # i don't think it's hdf's fault but this is still ridiculous
|
||||
hor2_offset = int(self.mChatMessage[OTHER_OFFSET].split(keyword)[0])
|
||||
vert2_offset = int(self.mChatMessage[OTHER_OFFSET].split(keyword)[1]) if len(self.mChatMessage[OTHER_OFFSET].split(keyword)) > 1 else 0
|
||||
else:
|
||||
hor2_offset = int(self.mChatMessage[OTHER_OFFSET])
|
||||
if self.mChatMessage[OTHER_OFFSET]:
|
||||
if "y_offset" in self.features: # AO 2.9
|
||||
keyword = "<and>" if "<and>" in self.mChatMessage[OTHER_OFFSET] else "&" # i don't think it's hdf's fault but this is still ridiculous
|
||||
hor2_offset = int(self.mChatMessage[OTHER_OFFSET].split(keyword)[0])
|
||||
vert2_offset = int(self.mChatMessage[OTHER_OFFSET].split(keyword)[1]) if len(self.mChatMessage[OTHER_OFFSET].split(keyword)) > 1 else 0
|
||||
else:
|
||||
hor2_offset = int(self.mChatMessage[OTHER_OFFSET]) if self.mChatMessage[OTHER_OFFSET] else 0
|
||||
|
||||
if side == "def":
|
||||
if hor2_offset > 0:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user