Skip to content

Added a set_attacker function to CBaseCSGrenadeProjectile for CS:GO. #366

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 3 commits into from
Dec 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 11 additions & 0 deletions addons/source-python/data/source-python/entities/csgo/CBaseCSGrenadeProjectile.ini
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
srv_check = False


[function]

[[set_attacker]]
identifier_windows = 55 8B EC 53 8B 5D 08 56 57 8B F9 53
identifier_linux = 55 89 E5 57 56 53 83 EC 2C C7 45 DC 00 00 00 00 8B 5D 08
arguments = POINTER


[property]

bounces = m_nBounces
Expand Down
10 changes: 9 additions & 1 deletion addons/source-python/packages/source-python/entities/engines/csgo/csgo.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
# >> IMPORTS
# =============================================================================
# Source.Python
from entities import BaseEntityGenerator
# Entities
from . import Entity as _Entity
from entities import BaseEntityGenerator
from entities.helpers import pointer_from_inthandle
# Weapons
from weapons.manager import weapon_manager


Expand Down Expand Up @@ -68,3 +71,8 @@ def find(cls, classname):
) in (index, 0):
return cls(entity.index)
return super().find(classname)

thrower = property(
lambda self: self.__getattr__('thrower'),
lambda self, inthandle: self.set_attacker(pointer_from_inthandle(inthandle))
)