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
Merge branch 'master' into 'csgo_weapons'
  • Loading branch information
satoon101 committed Oct 20, 2016
commit a89aac4ecf4c31180bc23b520eeea25da251cbf4
18 changes: 16 additions & 2 deletions addons/source-python/packages/source-python/entities/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def set_model(self, model):
def model_header(self):
"""Return a ModelHeader instance of the current entity's model."""
return model_cache.get_model_header(model_cache.find_model(
self.model.path))
self.model_name))

def get_property_bool(self, name):
"""Return the boolean property."""
Expand Down Expand Up @@ -596,7 +596,7 @@ def take_damage(
self.on_take_damage.skip_hooks(take_damage_info)
else:
self.on_take_damage(take_damage_info)

@wrap_entity_mem_func
def teleport(self, origin=None, angle=None, velocity=None):
"""Change the origin, angle and/or velocity of the entity.
Expand All @@ -609,3 +609,17 @@ def teleport(self, origin=None, angle=None, velocity=None):
New velocity of the entity.
"""
return [origin, angle, velocity]

@wrap_entity_mem_func
def set_parent(self, parent, attachment=INVALID_ATTACHMENT_INDEX):
"""Set the parent of the entity.

:param Pointer parent:
The parent.
:param str attachment:
The attachment name/index.
"""
if not isinstance(attachment, int):
attachment = self.lookup_attachment(attachment)

return [parent, attachment]
You are viewing a condensed version of this merge commit. You can view the full changes here.