mirror of
https://github.com/evennia/evennia.git
synced 2026-04-05 15:37:17 +02:00
Fixed some spurious bugs.
This commit is contained in:
parent
7e146eae11
commit
7818ca077a
2 changed files with 11 additions and 9 deletions
|
|
@ -250,14 +250,16 @@ class StateLightSourceOn(Script):
|
|||
prematurely, this hook will store the current
|
||||
burntime.
|
||||
"""
|
||||
# calculate remaining burntime
|
||||
try:
|
||||
time_burnt = time.time() - self.db.script_started
|
||||
except TypeError:
|
||||
# can happen if script_started is not defined
|
||||
time_burnt = self.interval
|
||||
burntime = self.interval - time_burnt
|
||||
self.obj.db.burntime = burntime
|
||||
# calculate remaining burntime, if object is not
|
||||
# already deleted (because it burned out)
|
||||
if self.obj:
|
||||
try:
|
||||
time_burnt = time.time() - self.db.script_started
|
||||
except TypeError:
|
||||
# can happen if script_started is not defined
|
||||
time_burnt = self.interval
|
||||
burntime = self.interval - time_burnt
|
||||
self.obj.db.burntime = burntime
|
||||
|
||||
def is_valid(self):
|
||||
"This script is only valid as long as the lightsource burns."
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ class WebClientSession(session.Session):
|
|||
Disconnect from server
|
||||
"""
|
||||
if reason:
|
||||
self.lineSend(self.suid, reason)
|
||||
self.client.lineSend(self.suid, reason)
|
||||
self.client.client_disconnect(self.suid)
|
||||
|
||||
def data_out(self, string='', data=None):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue