-
Notifications
You must be signed in to change notification settings - Fork 629
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 Lua onItemCheck #5857
Fix Lua onItemCheck #5857
Conversation
So caster is now unused? |
Yes, I can extend or modify the function to include the caster again. Or just change the place of the item return. Up to yall. Item was actually never being returned so you could never check anything about the item in onItemCheck |
I have added caster to its proper place:
|
onItemCheck was incorrectly returning the user in two parameters instead of the item in the second param slot
Zachs request has been compeleted: |
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.
I checked ccb_polymer_pump, all looks fine 👍
In the future, typically, you'd make the smaller logical changes or more sensitive changes in their own commit, and then the huge 2000+ file find/replace changes in another commit so things are more easily reviewable.
onItemCheck was incorrectly returning the user in two parameters instead of the item in the second param slot
I affirm:
This PR fixes onItemCheck to actually allow the item being used during the check to be referenced instead of the caster. The function is defined as:
OnItemCheck(CBaseEntity* PTarget, CItem* PItem, ITEMCHECK param, CBaseEntity* PCaster)
and was returning the following:
Target, Caster, param
it now returns:
result = onItemCheck(CLuaBaseEntity(PTarget), CLuaItem(PItem), static_cast<uint32>(param), caster)
Steps to test these changes
Reference item anywhere in onItemCheck
print(item) to see that you are indeed referencing an CLuaItem instead of CLuaBaseEntity