Skip to content

CS:GO weapons update #169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Dec 10, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merged master -> csgo_weapons
  • Loading branch information
satoon101 committed Dec 4, 2016
commit 17c3abbba96643d3c3ad643ea05747b34b58e43e
15 changes: 10 additions & 5 deletions addons/source-python/packages/source-python/entities/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,15 +500,20 @@ def _set_property(self, name, prop_type, value):
'Property "{0}" not found for entity type "{1}"'.format(
name, self.classname))

def delay(self, delay, callback, *args, **kwargs):
def delay(
self, delay, callback, args=(), kwargs=None,
cancel_on_level_end=False):
"""Execute a callback after the given delay.

:param int delay: The delay in seconds.
:param float delay: The delay in seconds.
:param callback: A callable object that should be called after the
delay expired.
:param args: Arguments that should be passed to the callback.
:param kwargs: Keyword arguments that should be passed to the
:param tuple args: Arguments that should be passed to the callback.
:param dict kwargs: Keyword arguments that should be passed to the
callback.
:param bool cancel_on_level_end: Whether or not to cancel the delay at
the end of the map.
:raises ValueError: If the given callback is not callable.

:return: The delay instance.
:rtype: Delay
Expand All @@ -530,7 +535,7 @@ def _callback(*args, **kwargs):
callback(*args, **kwargs)

# Get the delay instance...
delay = Delay(delay, _callback, *args, **kwargs)
delay = Delay(delay, _callback, args, kwargs, cancel_on_level_end)

# Add the delay to the dictionary...
_entity_delays[self.index].add(delay)
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.