Fixed rewinds on room switching
This commit is contained in:
parent
9769570a25
commit
6bef96673e
@ -186,9 +186,12 @@ class Room(object):
|
|||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
def getPosition(self):
|
def getPosition(self):
|
||||||
watcher = min(self._watchers.values())
|
if self._watchers:
|
||||||
self._setBy = watcher
|
watcher = min(self._watchers.values())
|
||||||
return watcher.getPosition()
|
self._setBy = watcher
|
||||||
|
return watcher.getPosition()
|
||||||
|
else:
|
||||||
|
return 0
|
||||||
|
|
||||||
def setPaused(self, paused=STATE_PAUSED, setBy=None):
|
def setPaused(self, paused=STATE_PAUSED, setBy=None):
|
||||||
self._playState = paused
|
self._playState = paused
|
||||||
@ -209,6 +212,8 @@ class Room(object):
|
|||||||
return self._watchers.values()
|
return self._watchers.values()
|
||||||
|
|
||||||
def addWatcher(self, watcher):
|
def addWatcher(self, watcher):
|
||||||
|
if self._watchers:
|
||||||
|
watcher.setPosition(self.getPosition())
|
||||||
self._watchers[watcher.getName()] = watcher
|
self._watchers[watcher.getName()] = watcher
|
||||||
watcher.setRoom(self)
|
watcher.setRoom(self)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user