Skip to content
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

Fix incorrect offset for CommitSuicide #2224

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

The-Doggy
Copy link
Contributor

Tested working on latest HL2:DM Linux DS using SM 1.12.0.7169 via the following test code:

#include <sdktools>

Handle Call_CommitSuicide;

public void OnPluginStart()
{
    RegConsoleCmd("sm_suicide", Command_Suicide);
    StartPrepSDKCall(SDKCall_Player);
    PrepSDKCall_SetVirtual(446);
    PrepSDKCall_AddParameter(SDKType_Bool, SDKPass_Plain);
    PrepSDKCall_AddParameter(SDKType_Bool, SDKPass_Plain);
    Call_CommitSuicide = EndPrepSDKCall();

    if(Call_CommitSuicide == INVALID_HANDLE)
    {
        SetFailState("Failed to setup CommitSuicide call");
    }
}

public Action Command_Suicide(int client, int args)
{
    if(IsClientInGame(client))
    {
        SDKCall(Call_CommitSuicide, client, false, false);
    }
    return Plugin_Handled;
}

Copy link
Member

@psychonic psychonic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@psychonic psychonic merged commit f586bc2 into alliedmodders:master Dec 9, 2024
3 of 4 checks passed
psychonic pushed a commit that referenced this pull request Dec 9, 2024
@Lunacy1984
Copy link

Thankyou for the fix. Just have to work on the other plugins on my side now

@LsLoki
Copy link

LsLoki commented Dec 17, 2024

On a Windows Server I get a server crash at map change using offset 446. Stable with 466. No issues on Linux.

@ambaca
Copy link
Contributor

ambaca commented Dec 18, 2024

On a Windows Server I get a server crash at map change using offset 446. Stable with 466. No issues on Linux.

I tested quickly on Windows 10

meta version
 Metamod:Source Version Information
    Metamod:Source version 1.11.0-dev+1156
    Plugin interface version: 16:14
    SourceHook version: 5:5
    Loaded As: Valve Server Plugin
    Compiled on: Nov 17 2024 09:57:24
    Built from: https://github.com/alliedmodders/metamod-source/commit/b795893
    Build ID: 1156:b795893
    http://www.metamodsource.net/
sm version
 SourceMod Version Information:
    SourceMod Version: 1.12.0.7172
    SourcePawn Engine: 1.12.0.7172, jit-x86 (build 1.12.0.7172)
    SourcePawn API: v1 = 5, v2 = 16
    Compiled on: Dec  9 2024 16:09:42
    Built from: https://github.com/alliedmodders/sourcemod/commit/e5921fed
    Build ID: 7172:e5921fed
    http://www.sourcemod.net/

and I did not get crash on map change or sm_slay or suicide.

Could you check also other plugins which could cause crash ?

*edit
why spoilers tag now work...

@LsLoki
Copy link

LsLoki commented Dec 19, 2024

On a Windows Server I get a server crash at map change using offset 446. Stable with 466. No issues on Linux.

I tested quickly on Windows 10
and I did not get crash on map change or sm_slay or suicide.
Could you check also other plugins which could cause crash ?

Installed SM...7172 on the offending Windows server, and all stable this time. Will monitor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants