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

AcceptEntityInput 64bit fix #2149

Merged
merged 3 commits into from
May 5, 2024

Conversation

bottiger1
Copy link
Contributor

Fixes AcceptEntityInput by using the struct definition instead of messy pointer math.

I could not add variant_t.cpp from the sdk because including cbase.h causes a large number of compile errors so I just pasted the 1 method into the sdktools file. If anyone wants to play around with making it work, you can uncomment the file include in the AMBuildScript file in the sdktools folder.

Includes a fix to bintools from malifox which is supposedly related, but I have no idea what it does to be honest.

#2119

I only tested and confirmed this works on Linux and only on int and string variants.

@Kenzzer
Copy link
Member

Kenzzer commented May 4, 2024

Thank you for continuing PR. Looks like this is going to require some fixing on the hl2sdks before the CI can pass.

Edit: Editing the AMBuild file of sdktools to suppress the warning-error, could also work.

@bottiger1
Copy link
Contributor Author

bottiger1 commented May 4, 2024

It looks like the problem with the CI is because it is not finding variant_t.h from the SDK for some reason.

-I /home/runner/work/sourcemod/sourcemod/dependencies/hl2sdk-episode1/game/server 
-I /home/runner/work/sourcemod/sourcemod/dependencies/hl2sdk-episode1/game/shared 

-MD -MF inputnatives.d -c /home/runner/work/sourcemod/sourcemod/sourcemod/extensions/sdktools/inputnatives.cpp -o inputnatives.o
/home/runner/work/sourcemod/sourcemod/sourcemod/extensions/sdktools/variant-t.h:35:10: fatal error: 'variant_t.h' file not found

The include output looks correct except for the fact that game/shared doesn't exist in episode1, it is called game_shared, However game/server/variant_t.h does exist but the compiler says it still can't be found.

https://github.com/alliedmodders/hl2sdk/blob/78dab58646d5983c77af44c45a877b89196eb82c/game/server/variant_t.h

I'm going to chalk this up to a CI or ambuild problem.

@bottiger1
Copy link
Contributor Author

bottiger1 commented May 4, 2024

I think I fixed episode1, but now it is complaining about the SDK. So I believe it's up to @psychonic whether we ignore this error or edit all the SDKs. I think I've done all I can here. Strangely I don't get this error when I compile.

/home/runner/work/sourcemod/sourcemod/dependencies/hl2sdk-csgo/game/server/variant_t.h:42:16: error: field 'fieldType' will be initialized after field 'iVal' [-Werror,-Wreorder-ctor]
        variant_t() : fieldType(FIELD_VOID), iVal(0) {}
                      ^~~~~~~~~~~~~~~~~~~~~  ~~~~~~~
                      iVal(0)                fieldType(FIELD_VOID)

@psychonic
Copy link
Member

So I believe it's up to @psychonic whether we ignore this error or edit all the SDKs. I think I've done all I can here. Strangely I don't get this error when I compile.

/home/runner/work/sourcemod/sourcemod/dependencies/hl2sdk-csgo/game/server/variant_t.h:42:16: error: field 'fieldType' will be initialized after field 'iVal' [-Werror,-Wreorder-ctor]
        variant_t() : fieldType(FIELD_VOID), iVal(0) {}
                      ^~~~~~~~~~~~~~~~~~~~~  ~~~~~~~
                      iVal(0)                fieldType(FIELD_VOID)

I've now updated the SDK branches that had the bad initialization order.

@psychonic
Copy link
Member

Thanks for tackling the rest of this

@psychonic psychonic merged commit 5cb2d68 into alliedmodders:master May 5, 2024
4 checks passed
@bottiger1 bottiger1 deleted the AcceptEntityInputFix branch May 6, 2024 00:55
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