-
Notifications
You must be signed in to change notification settings - Fork 11
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
Few misc changes #54
base: master
Are you sure you want to change the base?
Few misc changes #54
Conversation
CppHorse
commented
Apr 14, 2023
- Fixed fixed-size array syntax error in tf2utils.inc
- Fixed few warnings in cwx.sp
- Moved IsEmpty() check in GetLoadoutItem so if we no longer equip a custom weapon, it equips our loadout's instead.
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.
Thanks for the PR — I'm struggling to recall why OnGetLoadoutItemPost
was written the way it was, but if you can split that into its own PR for further evaluation and make the following changes I can take the rest as allowing the plugin to be compiled on SM 1.11.
third_party/vendored/tf2utils.inc
Outdated
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.
Probably better to do a bringup of the vendored script to version 0.18.0 just so it's in sync with a tagged release with only the features the plugin depends on.
scripting/cwx.sp
Outdated
@@ -632,6 +633,7 @@ int Native_RemovePlayerLoadoutItem(Handle plugin, int argc) { | |||
int flags = GetNativeCell(4); | |||
|
|||
UnsetClientCustomLoadoutItem(client, playerClass, itemSlot, flags); | |||
return true; |
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.
CWX_RemovePlayerLoadoutItem
returns void, so if anything this should return 0.
int storedItem = g_CurrentLoadout[client][playerClass][loadoutSlot].entity; | ||
if (!IsValidEntity(storedItem) || GetEntityFlags(storedItem) & FL_KILLME | ||
|| !HasEntProp(storedItem, Prop_Send, "m_Item")) { | ||
// the loadout entity we keep track of isn't valid, so we may need to make one |
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 feel like there's a reason this wasn't hoisted. Can't think of it at the moment.
4396d59
to
9f73dd5
Compare
- Fixed fixed-size array syntax error in tf2utils.inc - Fixed few warnings in cwx.sp - Moved IsEmpty() check in GetLoadoutItem so if we no longer equip a custom weapon, it equips our loadout's instead.