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

Added hitgroup to CTakeDamageInfo #665

Merged
merged 9 commits into from
Nov 23, 2024
Merged

Conversation

schwarper
Copy link
Contributor

@schwarper schwarper commented Nov 9, 2024

image

public static HookResult OnTakeDamage(DynamicHook hook)
{
    CEntityInstance entity = hook.GetParam<CEntityInstance>(0);

    if (entity.DesignerName != "player")
    {
        return HookResult.Continue;
    }

    var info = hook.GetParam<CTakeDamageInfo>(1);

    Server.PrintToChatAll($"HEY {info.Attacker.Value?.DesignerName} -> {info.GetHitGroup()}");
    return HookResult.Continue;
}

@schwarper schwarper requested a review from roflmuffin as a code owner November 9, 2024 22:55
@roflmuffin
Copy link
Owner

The changed file is a generated file so you'll need to make a new file with a partial class to extend the generated code

@KillStr3aK
Copy link
Contributor

KillStr3aK commented Nov 15, 2024

this also could be a property instead? (by name)

or could be renamed* 'GetHitGroup'?

@schwarper
Copy link
Contributor Author

this also could be a property instead? (by name)

or could be renamed* 'GetHitGroup'?

I guess GetHitGroup is better than HitGroup.

@KillStr3aK
Copy link
Contributor

this also could be a property instead? (by name)

or could be renamed* 'GetHitGroup'?

I guess GetHitGroup is better than HitGroup.

indeed, but 'HitGroyp' also stands good if its a property, not a method

@roflmuffin roflmuffin enabled auto-merge (squash) November 23, 2024 10:01
@roflmuffin roflmuffin merged commit 7929751 into roflmuffin:main Nov 23, 2024
5 checks passed
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.

3 participants