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 DMG_LASTGENERICFLAG and DMG_HEADSHOT defines #924

Closed
wants to merge 1 commit into from
Closed

Added DMG_LASTGENERICFLAG and DMG_HEADSHOT defines #924

wants to merge 1 commit into from

Conversation

dragokas
Copy link
Contributor

@Bara
Copy link
Contributor

Bara commented Nov 14, 2018

@dragokas
Copy link
Contributor Author

I can't test it in CSGO.
I tested it in Left4dead, where SDKHook_OnTakeDamage returned me DMG_LASTGENERICFLAG in some cases.
As about headshots, SDKHook in L4D returns -2147483646 mean (1 << 31) | DMG_BULLET
So, CSGO constants are not applicable for some another games.

@Bara
Copy link
Contributor

Bara commented Nov 14, 2018

So in CSGO is DMG_LASTGENERICFLAG = Headshot

@@ -69,6 +69,8 @@
#define DMG_BLAST_SURFACE (1 << 27) /**< A blast on the surface of water that cannot harm things underwater */
#define DMG_DIRECT (1 << 28)
#define DMG_BUCKSHOT (1 << 29) /**< not quite a bullet. Little, rounder, different. */
#define DMG_LASTGENERICFLAG (1 << 30)
Copy link
Member

Choose a reason for hiding this comment

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

This is not necessary to be included, it only exists as an base point for other definitions near the msb.

@@ -69,6 +69,8 @@
#define DMG_BLAST_SURFACE (1 << 27) /**< A blast on the surface of water that cannot harm things underwater */
#define DMG_DIRECT (1 << 28)
#define DMG_BUCKSHOT (1 << 29) /**< not quite a bullet. Little, rounder, different. */
#define DMG_LASTGENERICFLAG (1 << 30)
#define DMG_HEADSHOT (1 << 31) /**< Damage from a headshot. */
Copy link
Member

Choose a reason for hiding this comment

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

We should probably define what games do or don't support this

Copy link
Member

@Headline Headline left a comment

Choose a reason for hiding this comment

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

DMG_HEADSHOT can be useful for some games, thanks for opening this pr

@Headline Headline added the Feature Request user requested feature label Nov 27, 2018
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.

DMG_LASTGENERICFLAG indeed does not seem useful. As @Headline noted, its use is for the programmers of the game itself to easier add new ones without stomping on the built-in types.

Ex.

#define DMG_BLAH    (DMG_LASTGENERICFLAG+1)
#define DMG_BLAH2  (DMG_LASTGENERICFLAG+2)

Headshot is going to be game-specific (as hinted by it being greater than DMG_LASTGENERICFLAG. I don't think it necessarily belongs in sdkhooks.inc, but if putting it there, I think doing something like DMG_CSGO_HEADSHOT is more appropriate. Alternatively, it could go in cstrike.inc with a name like that.

@Headline
Copy link
Member

Headline commented Feb 9, 2020

closing this as it is stale, if you’d like to reopen this pull request please address required changes and reopen it once you’re ready

thank you!

@Headline Headline closed this Feb 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request user requested feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants