-
Notifications
You must be signed in to change notification settings - Fork 94
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
base: develop
Are you sure you want to change the base?
Conversation
lua/pac3/core/client/parts/event.lua
Outdated
callback = function(self, ent, find, time) | ||
time = time or 0.1 | ||
callback = function(self, ent, find_ammo, time) | ||
local time = time or 0.1 |
There was a problem hiding this comment.
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
|
||
if ent.pac_hide_bullets then | ||
return false | ||
end |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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
That's pretty much my final commit on this PR unless there's something I should amend. Awaiting approval, and I'll merge after. |
Made the fire_bullets event functional again.