Update torchlight_changes_unloze/torchlight3/Torchlight/Commands.py
This commit is contained in:
parent
9e7b69d6b0
commit
4692bffe08
@ -1636,13 +1636,28 @@ class Stop(BaseCommand):
|
||||
|
||||
result = tl.AudioManager.Stop(player, extra)
|
||||
|
||||
if not result or result.get("matched", 0) == 0:
|
||||
if not result or result.get("active", 0) == 0:
|
||||
if extra:
|
||||
tl.SayPrivate(player, f"[STOP] No active audio matched \"{extra}\".")
|
||||
else:
|
||||
tl.SayPrivate(player, "[STOP] No active audio to stop.")
|
||||
elif result.get("matched", 0) == 0:
|
||||
if result.get("pending", 0) > 0:
|
||||
tl.SayPrivate(
|
||||
player,
|
||||
"[STOP] You cannot stop audio from a higher level user."
|
||||
)
|
||||
elif extra:
|
||||
tl.SayPrivate(player, f"[STOP] No active audio matched \"{extra}\".")
|
||||
else:
|
||||
tl.SayPrivate(player, "[STOP] No audio clips matched your stop request.")
|
||||
elif result.get("stopped", 0) > 0:
|
||||
tl.SayPrivate(player, f"[STOP] Stopped {result['stopped']} audio clip(s).")
|
||||
if result.get("pending", 0) > 0:
|
||||
tl.SayPrivate(
|
||||
player,
|
||||
"[STOP] Some audio could not be stopped due to user level."
|
||||
)
|
||||
except Exception as e:
|
||||
self.Logger.error(f"Stop command failed: {e}")
|
||||
tl.SayPrivate(player, f"[STOP] Error: {str(e)}")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user