Update torchlight_changes_unloze/torchlight3/Torchlight/AudioManager.py
This commit is contained in:
parent
5b20363e01
commit
828d5fbd31
@ -272,10 +272,6 @@ class AudioManager():
|
||||
return True
|
||||
|
||||
def Stop(self, player, extra):
|
||||
Level = 0
|
||||
if player.Access:
|
||||
Level = player.Access["level"]
|
||||
StopLevel = self.Torchlight().Config["AntiSpam"]["StopLevel"]
|
||||
ExtraFilter = extra.strip().lower() if isinstance(extra, str) else ""
|
||||
Result = {"matched": 0, "stopped": 0, "pending": 0}
|
||||
|
||||
@ -284,23 +280,6 @@ class AudioManager():
|
||||
continue
|
||||
Result["matched"] += 1
|
||||
|
||||
# Always allow users to stop their own clip immediately.
|
||||
requires_votes = player != AudioClip.Player and \
|
||||
(not Level or (Level < AudioClip.Level and Level < StopLevel))
|
||||
|
||||
if requires_votes:
|
||||
AudioClip.Stops.add(player.UserID)
|
||||
|
||||
if len(AudioClip.Stops) >= 3:
|
||||
AudioClip.Stop()
|
||||
Result["stopped"] += 1
|
||||
self.Torchlight().SayPrivate(AudioClip.Player, "Your audio clip was stopped.")
|
||||
if player != AudioClip.Player:
|
||||
self.Torchlight().SayPrivate(player, "Stopped \"{0}\"({1}) audio clip.".format(AudioClip.Player.Name, AudioClip.Player.UserID))
|
||||
else:
|
||||
Result["pending"] += 1
|
||||
self.Torchlight().SayPrivate(player, "This audio clip needs {0} more !stop's.".format(3 - len(AudioClip.Stops)))
|
||||
else:
|
||||
AudioClip.Stop()
|
||||
Result["stopped"] += 1
|
||||
self.Torchlight().SayPrivate(AudioClip.Player, "Your audio clip was stopped.")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user