From af96d64f8fe274c5f859d0a8758ca5539d4b680a Mon Sep 17 00:00:00 2001 From: Jonathan <30329245+CookStar@users.noreply.github.com> Date: Thu, 3 Dec 2020 06:58:36 +0900 Subject: [PATCH 1/3] Added a set_attacker function to CBaseCSGrenadeProjectile for CS:GO. --- .../entities/csgo/CBaseCSGrenadeProjectile.ini | 11 +++++++++++ 1 file changed, 11 insertions(+) mode change 100644 => 100755 addons/source-python/data/source-python/entities/csgo/CBaseCSGrenadeProjectile.ini diff --git a/addons/source-python/data/source-python/entities/csgo/CBaseCSGrenadeProjectile.ini b/addons/source-python/data/source-python/entities/csgo/CBaseCSGrenadeProjectile.ini old mode 100644 new mode 100755 index 14ee588fb..1fa4463dd --- a/addons/source-python/data/source-python/entities/csgo/CBaseCSGrenadeProjectile.ini +++ b/addons/source-python/data/source-python/entities/csgo/CBaseCSGrenadeProjectile.ini @@ -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 From 5f49fa0229ca78650d8ba397ff05ffd29a3cdf39 Mon Sep 17 00:00:00 2001 From: Jonathan <30329245+CookStar@users.noreply.github.com> Date: Tue, 8 Dec 2020 09:28:56 +0900 Subject: [PATCH 2/3] Changed to make the thrower set the attacker in CS:GO. --- .../source-python/entities/engines/csgo/csgo.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) mode change 100644 => 100755 addons/source-python/packages/source-python/entities/engines/csgo/csgo.py diff --git a/addons/source-python/packages/source-python/entities/engines/csgo/csgo.py b/addons/source-python/packages/source-python/entities/engines/csgo/csgo.py old mode 100644 new mode 100755 index 44d31e8b9..0a8d6c973 --- a/addons/source-python/packages/source-python/entities/engines/csgo/csgo.py +++ b/addons/source-python/packages/source-python/entities/engines/csgo/csgo.py @@ -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 @@ -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, value: self.set_attacker(pointer_from_inthandle(value)) + ) From 4dbe2392d1839be292bcc40c7dd119f80b8a836f Mon Sep 17 00:00:00 2001 From: Jonathan <30329245+CookStar@users.noreply.github.com> Date: Tue, 8 Dec 2020 09:47:38 +0900 Subject: [PATCH 3/3] Rename the argument. --- .../packages/source-python/entities/engines/csgo/csgo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/source-python/packages/source-python/entities/engines/csgo/csgo.py b/addons/source-python/packages/source-python/entities/engines/csgo/csgo.py index 0a8d6c973..70007f06e 100755 --- a/addons/source-python/packages/source-python/entities/engines/csgo/csgo.py +++ b/addons/source-python/packages/source-python/entities/engines/csgo/csgo.py @@ -74,5 +74,5 @@ def find(cls, classname): thrower = property( lambda self: self.__getattr__('thrower'), - lambda self, value: self.set_attacker(pointer_from_inthandle(value)) + lambda self, inthandle: self.set_attacker(pointer_from_inthandle(inthandle)) )