I didn't like the fire name but whatever

This commit is contained in:
Dico200
2015-11-26 15:14:42 +01:00
parent a59f67785c
commit c76f8373ef
2 changed files with 4 additions and 4 deletions

View File

@@ -23,7 +23,7 @@ class base_event():
if prior == priority:
self._handlers[priorities.index(prior)].append(function)
def call(self,*args):
def fire(self,*args):
for priority in self._handlers:
for handler in priority:
handler(self,*args)
@@ -45,7 +45,7 @@ def add_event(event_name, event_class = base_event):
event = event_class(event_name)
events.append(event)
def call_event(event_name,*args):
def fire_event(event_name,*args):
"""
# Calls the ehe event with the given arguments
"""

View File

@@ -106,7 +106,9 @@ class Command(object):
def execute_checks(self, sender, command, label, args):
# ---- Check sender type ----
if is_player(sender):
Validate.is_true(self.type != Command.SENDER_CONSOLE, "That command can only be used by the console")
sender = py_players[sender]
else:
Validate.is_true(self.type != Command.SENDER_PLAYER, "That command can only be used by players")
@@ -130,8 +132,6 @@ class Command(object):
return self.help()
# ---- Set up passed arguments, prepare for handler call ----
if is_player(sender):
sender = py_players[sender]
scape = Command_scape(args, self.arguments, command, label)
if is_player(sender):
sender = py_players[sender]