I didn't like the fire name but whatever
This commit is contained in:
@@ -23,7 +23,7 @@ class base_event():
|
|||||||
if prior == priority:
|
if prior == priority:
|
||||||
self._handlers[priorities.index(prior)].append(function)
|
self._handlers[priorities.index(prior)].append(function)
|
||||||
|
|
||||||
def call(self,*args):
|
def fire(self,*args):
|
||||||
for priority in self._handlers:
|
for priority in self._handlers:
|
||||||
for handler in priority:
|
for handler in priority:
|
||||||
handler(self,*args)
|
handler(self,*args)
|
||||||
@@ -45,7 +45,7 @@ def add_event(event_name, event_class = base_event):
|
|||||||
event = event_class(event_name)
|
event = event_class(event_name)
|
||||||
events.append(event)
|
events.append(event)
|
||||||
|
|
||||||
def call_event(event_name,*args):
|
def fire_event(event_name,*args):
|
||||||
"""
|
"""
|
||||||
# Calls the ehe event with the given arguments
|
# Calls the ehe event with the given arguments
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -106,7 +106,9 @@ class Command(object):
|
|||||||
def execute_checks(self, sender, command, label, args):
|
def execute_checks(self, sender, command, label, args):
|
||||||
|
|
||||||
# ---- Check sender type ----
|
# ---- Check sender type ----
|
||||||
|
if is_player(sender):
|
||||||
Validate.is_true(self.type != Command.SENDER_CONSOLE, "That command can only be used by the console")
|
Validate.is_true(self.type != Command.SENDER_CONSOLE, "That command can only be used by the console")
|
||||||
|
sender = py_players[sender]
|
||||||
else:
|
else:
|
||||||
Validate.is_true(self.type != Command.SENDER_PLAYER, "That command can only be used by players")
|
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()
|
return self.help()
|
||||||
|
|
||||||
# ---- Set up passed arguments, prepare for handler call ----
|
# ---- Set up passed arguments, prepare for handler call ----
|
||||||
if is_player(sender):
|
|
||||||
sender = py_players[sender]
|
|
||||||
scape = Command_scape(args, self.arguments, command, label)
|
scape = Command_scape(args, self.arguments, command, label)
|
||||||
if is_player(sender):
|
if is_player(sender):
|
||||||
sender = py_players[sender]
|
sender = py_players[sender]
|
||||||
|
|||||||
Reference in New Issue
Block a user