Skip to content

Commit 1f1092c

Browse files
authored
updating 2.4.0 (#176)
1 parent fd1ab92 commit 1f1092c

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

Resources/RetakesAllocator_gamedata.json

+14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
{
2+
"GetCSWeaponDataFromKey": {
3+
"signatures": {
4+
"library": "server",
5+
"windows": "48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC ? 48 8B FA 8B F1 48 85 D2 0F 84",
6+
"linux": "55 48 89 E5 41 57 41 56 41 89 FE 41 55 41 54 45"
7+
}
8+
},
9+
"CCSPlayer_ItemServices_CanAcquire": {
10+
"signatures": {
11+
"library": "server",
12+
"windows": "44 89 44 24 ? 48 89 54 24 ? 48 89 4C 24 ? 55 56 57 41 54 41 55 41 56 41 57 48 8B EC",
13+
"linux": "55 48 89 E5 41 57 41 56 41 55 49 89 CD 41 54 53 48 83 EC"
14+
}
15+
},
216
"GiveNamedItem2": {
317
"signatures": {
418
"library": "server",

RetakesAllocator/CustomGameData.cs

+5-7
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,16 @@ public class CustomGameData
1212
{
1313
public static Dictionary<string, Dictionary<OSPlatform, string>> _customGameData = new();
1414
private readonly MemoryFunctionVoid<IntPtr, string, IntPtr, IntPtr, IntPtr, IntPtr, IntPtr, IntPtr> GiveNamedItem2;
15-
16-
public readonly
17-
MemoryFunctionWithReturn<CCSPlayer_ItemServices, CEconItemView, AcquireMethod, NativeObject, AcquireResult>
18-
CCSPlayer_ItemServices_CanAcquireFunc = new(GameData.GetSignature("CCSPlayer_ItemServices_CanAcquire"));
19-
20-
public readonly MemoryFunctionWithReturn<int, string, CCSWeaponBaseVData> GetCSWeaponDataFromKeyFunc = new(GameData.GetSignature("GetCSWeaponDataFromKey"));
15+
public readonly MemoryFunctionWithReturn<CCSPlayer_ItemServices, CEconItemView, AcquireMethod, NativeObject, AcquireResult> CCSPlayer_ItemServices_CanAcquireFunc;
16+
public readonly MemoryFunctionWithReturn<int, string, CCSWeaponBaseVData> GetCSWeaponDataFromKeyFunc;
2117

2218
public CustomGameData()
2319
{
2420
LoadCustomGameDataFromJson();
25-
21+
2622
GiveNamedItem2 = new(GetCustomGameDataKey("GiveNamedItem2"));
23+
CCSPlayer_ItemServices_CanAcquireFunc = new(GetCustomGameDataKey("CCSPlayer_ItemServices_CanAcquire"));
24+
GetCSWeaponDataFromKeyFunc = new(GetCustomGameDataKey("GetCSWeaponDataFromKey"));
2725
}
2826
public void LoadCustomGameDataFromJson()
2927
{

RetakesAllocator/RetakesAllocator.cs

+2-8
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public override void Load(bool hotReload)
8181

8282
CustomFunctions = new();
8383

84-
if (Configs.GetConfigData().EnableCanAcquireHook && !Helpers.IsWindows())
84+
if (Configs.GetConfigData().EnableCanAcquireHook)
8585
{
8686
CustomFunctions.CCSPlayer_ItemServices_CanAcquireFunc.Hook(OnWeaponCanAcquire, HookMode.Pre);
8787
}
@@ -353,13 +353,7 @@ public void OnPrintConfigCommand(CCSPlayerController? player, CommandInfo comman
353353
public HookResult OnWeaponCanAcquire(DynamicHook hook)
354354
{
355355
Log.Debug("OnWeaponCanAcquire");
356-
// GetCSWeaponDataFromKeyFunc doesnt work on windows
357-
if (Helpers.IsWindows())
358-
{
359-
Log.Debug("Exit early");
360-
return HookResult.Continue;
361-
}
362-
356+
363357
var acquireMethod = hook.GetParam<AcquireMethod>(2);
364358
if (acquireMethod == AcquireMethod.PickUp)
365359
{

0 commit comments

Comments
 (0)