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 "fire_bullets" event from erroring. #1350

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

unknao
Copy link
Contributor

@unknao unknao commented Apr 18, 2024

Made the fire_bullets event functional again.

callback = function(self, ent, find, time)
time = time or 0.1
callback = function(self, ent, find_ammo, time)
local time = time or 0.1
Copy link
Collaborator

Choose a reason for hiding this comment

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

This local isn't needed

Comment on lines -3385 to -3388

if ent.pac_hide_bullets then
return false
end
Copy link
Collaborator

Choose a reason for hiding this comment

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

Idk if removing this is right. Someone else verify

Copy link
Collaborator

Choose a reason for hiding this comment

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

At first glance, if we search "pac_hide_bullets", it seemed as though the field isn't created anywhere (so, accessing it would always be nil if that was the case)
But, if we run the search without the pac_ prefix, it leads to EntityField functions, the builder thing that set an entity field with that prefix.
(for OP's information) This one wasn't obvious, that prefix business is just a thing that we do a few times throughout the code.

We still want that return because we still want the option to hide the bullets.

But there's some side issues in singleplayer. I tried to test, it appears the EntityFireBullets hook is ineffective. But it's fine with local server and p2p setups for some reason... oh well!

Copy link
Collaborator

Choose a reason for hiding this comment

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

@unknao can you revert this change?

I found that the hook is ineffective on singleplayer, so some networking was needed

and add enum builder for bullet types, as well as some defaults
@pingu7867
Copy link
Collaborator

That's pretty much my final commit on this PR unless there's something I should amend. Awaiting approval, and I'll merge after.

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