File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed
configs/addons/counterstrikesharp/gamedata
managed/CounterStrikeSharp.API/Core/Model Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 132132 "linux" : 26
133133 }
134134 },
135+ "CTakeDamageInfo_HitGroup" : {
136+ "offsets" : {
137+ "windows" : 104 ,
138+ "linux" : 104
139+ }
140+ },
135141 "UTIL_CreateEntityByName" : {
136142 "signatures" : {
137143 "library" : " server" ,
Original file line number Diff line number Diff line change @@ -11,9 +11,22 @@ public partial class CTakeDamageInfo
1111 /// Returns a <see cref="HitGroup_t"/> enumeration representing the player's current hit group,
1212 /// or <see cref="HitGroup_t.HITGROUP_INVALID"/> if the hit group cannot be determined.
1313 /// </returns>
14- [ Obsolete ( "Use HitGroupId instead." ) ]
1514 public HitGroup_t GetHitGroup ( )
1615 {
17- return HitGroupId ;
16+ IntPtr v4 = Marshal . ReadIntPtr ( Handle , GameData . GetOffset ( "CTakeDamageInfo_HitGroup" ) ) ;
17+
18+ if ( v4 == nint . Zero )
19+ {
20+ return HitGroup_t . HITGROUP_INVALID ;
21+ }
22+
23+ IntPtr v1 = Marshal . ReadIntPtr ( v4 , 16 ) ;
24+
25+ if ( v1 == nint . Zero )
26+ {
27+ return HitGroup_t . HITGROUP_GENERIC ;
28+ }
29+
30+ return ( HitGroup_t ) Marshal . ReadInt32 ( v1 , 56 ) ;
1831 }
1932}
You can’t perform that action at this time.
0 commit comments