Skip to content

Commit

Permalink
Merge pull request #18 from HvH-gg/update-offset
Browse files Browse the repository at this point in the history
fix: updated basecmd offset
  • Loading branch information
imi-tat0r authored Aug 15, 2024
2 parents f643f80 + ede0cae commit c27b628
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 12 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,18 @@ jobs:
- name: Restore dependencies
run: dotnet restore

- name: Publish artifacts
- name: Build
run: dotnet build -c Release --no-restore /p:Version=${{ env.VERSION_NUMBER }}
- name: Check contents of bin/Release directory

- name: Copy CSSharpUtils.dll
run: |
echo "Listing contents of CS2-Essentials/bin/Release/net8.0/"
ls -la CS2-Essentials/bin/Release/net8.0/
mkdir -p release/addons/counterstrikesharp/plugins/CS2-Essentials
CSSharpUtilsDllPath=$(find ~/.nuget/packages/cssharputils/ -name "CSSharpUtils.dll" | head -n 1)
if [ -z "$CSSharpUtilsDllPath" ]; then
echo "CSSharpUtils.dll not found. Exiting."
exit 1
fi
cp "$CSSharpUtilsDllPath" release/addons/counterstrikesharp/plugins/CS2-Essentials/
- name: Create necessary directory structure and copy files
run: |
Expand Down
2 changes: 1 addition & 1 deletion CS2-Essentials/CS2-Essentials.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.246" />
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.255" />
<PackageReference Include="CS2-CustomVotes.Shared" Version="1.1.0" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion CS2-Essentials/CUserCmd.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public CUserCmd(IntPtr pointer)
if (Handle == IntPtr.Zero)
return null;

var baseCmd = Unsafe.Read<IntPtr>((void*)(Handle + 0x30));
var baseCmd = Unsafe.Read<IntPtr>((void*)(Handle + 0x40));
if (baseCmd == IntPtr.Zero)
return null;

Expand Down
2 changes: 1 addition & 1 deletion CS2-Essentials/Features/RapidFireFix.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public HookResult OnWeaponFire(EventWeaponFire eventWeaponFire, GameEventInfo in
if (!eventWeaponFire.Userid.IsPlayer())
return HookResult.Continue;

var firedWeapon = eventWeaponFire.Userid.Pawn.Value?.WeaponServices?.ActiveWeapon.Value;
var firedWeapon = eventWeaponFire.Userid!.Pawn.Value?.WeaponServices?.ActiveWeapon.Value;
var weaponData = firedWeapon?.GetVData<CCSWeaponBaseVData>();

var index = eventWeaponFire.Userid.Pawn.Index;
Expand Down
2 changes: 1 addition & 1 deletion CS2-Essentials/Features/TeleportFix.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public HookResult RunCommand(DynamicHook h)
viewAngles.Fix();

// not warned yet or last warning was more than 3 seconds ago
if (_teleportBlockWarnings.TryGetValue(player.Index, out var lastWarningTime) &&
if (_teleportBlockWarnings.TryGetValue(player!.Index, out var lastWarningTime) &&
!(lastWarningTime + 3 <= Server.CurrentTime))
return HookResult.Changed;

Expand Down
2 changes: 1 addition & 1 deletion CS2-Essentials/Features/WeaponRestrict.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public HookResult OnItemPurchase(EventItemPurchase eventItemPurchase, GameEventI
return HookResult.Continue;

// not exceeding limits
var weaponsInTeam = GetWeaponCountInTeam(item, player.Team);
var weaponsInTeam = GetWeaponCountInTeam(item, player!.Team);
var allowedWeapons = GetAllowedWeaponCount(item);

var willExceedLimits = allowedWeapons != -1 && weaponsInTeam + 1 > allowedWeapons;
Expand Down
4 changes: 2 additions & 2 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![Copyright ev0lve Digital](https://img.shields.io/badge/Copyright-ev0lve%20Digital-blue) ![GitHub License](https://img.shields.io/github/license/HvH-gg/CS2-Essentials) ![Issues](https://img.shields.io/github/issues/HvH-gg/CS2-Essentials) ![Downloads](https://img.shields.io/github/downloads/HvH-gg/CS2-Essentials/total) ![Stars](https://img.shields.io/github/stars/HvH-gg/CS2-Essentials)

# [HvH.gg](https://hvh.gg) CS2 Essentials (1.2.4)
# [HvH.gg](https://hvh.gg) CS2 Essentials (1.2.5)
### If you use this plugin, you do NOT need [RapidFireFix](https://github.com/HvH-gg/RapidFireFix) anymore.

Our CS2 Essentials plugin is the only plugin you need to run a successful HvH server. It includes basic features like **reset score** and **rage quit** as well as optional restrictions for **weapons**, **friendly fire**, **rapid fire** and other exploit/crash fixes.
Expand All @@ -16,7 +16,7 @@ Our CS2 Essentials plugin is the only plugin you need to run a successful HvH se

# Requirements
- [Metamod:Source](https://www.sourcemm.net/downloads.php/?branch=master)
- [CounterStrikeSharp(v191)](https://github.com/roflmuffin/CounterStrikeSharp/releases)
- [CounterStrikeSharp(v255)](https://github.com/roflmuffin/CounterStrikeSharp/releases)

# Install
1. Install Metamod:Source and CounterStrikeSharp
Expand Down

0 comments on commit c27b628

Please sign in to comment.