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

Weapon support for sit sequences #19

Merged
merged 2 commits into from
Dec 27, 2024

Conversation

afxnatic
Copy link
Contributor

Tested on a listen server, works well. I recommend caching the ent/player functions as CalcMainActivity is a very expensive hook and lowering __index calls is an easy way to save on performance.

image

@StyledStrike
Copy link
Owner

Oh it looks like sitFormat is not defined anywhere on this pull request, so as long as you get on a seat with the sit sequence (like seats #6 or #7 on the Insurgent) and have a weapon on your hand, it will cause errors.

Also, since all the values returned by Weapon:GetHoldType are known, using string.format is not necessary, you can use a table as a dictionary like this:

local holdTypeSequence = {
    ["pistol"] = "sequence_name_here",
    ["smg"] = "sequence_name_here",
    ...
}

hook.Add( "CalcMainActivity", "Glide.OverridePlayerActivity", function( ply )
    ...
    local sequenceID = ply:LookupSequence( holdTypeSequence[holdType] )

You can find all hold types here.

@afxnatic
Copy link
Contributor Author

Try again, should work now

@StyledStrike StyledStrike added the enhancement New feature or request label Dec 27, 2024
@StyledStrike StyledStrike merged commit 0c3e773 into StyledStrike:main Dec 27, 2024
1 check passed
@StyledStrike
Copy link
Owner

Tested with Seat Weaponizer, looks good, thanks

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

Successfully merging this pull request may close these issues.

2 participants