Skip to content

Commit

Permalink
Fix narration for demos in a proper way
Browse files Browse the repository at this point in the history
(without saving it as a last message because that only made things worse)
  • Loading branch information
Crystalwarrior committed Nov 8, 2023
1 parent 7967ed2 commit 5810aac
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions server/area.py
Original file line number Diff line number Diff line change
Expand Up @@ -2144,13 +2144,29 @@ def play_demo(self, client):
return
elif len(client.broadcast_list) > 0:
for area in client.broadcast_list:
area.send_command(header, *args)
if header == "MS":
area.last_ic_message = tuple(args)
# If we're on narration pos
if args[5] == "":
if area.last_ic_message is not None:
# Set the pos to last message's pos
args[5] = area.last_ic_message[5]
else:
# Set the pos to the 0th pos-lock
if len(self.pos_lock) > 0:
args[5] = self.pos_lock[0]
area.send_command(header, *args)
else:
self.send_command(header, *args)
if header == "MS":
self.last_ic_message = tuple(args)
# If we're on narration pos
if args[5] == "":
if self.last_ic_message is not None:
# Set the pos to last message's pos
args[5] = self.last_ic_message[5]
else:
# Set the pos to the 0th pos-lock
if len(self.pos_lock) > 0:
args[5] = self.pos_lock[0]
self.send_command(header, *args)
# Proceed to next demo line
self.play_demo(client)

Expand Down

0 comments on commit 5810aac

Please sign in to comment.