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

Few misc changes #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Few misc changes #54

wants to merge 1 commit into from

Conversation

CppHorse
Copy link
Contributor

  • 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.

Copy link
Owner

@nosoop nosoop left a 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.

Copy link
Owner

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;
Copy link
Owner

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
Copy link
Owner

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.

@CppHorse CppHorse force-pushed the master branch 3 times, most recently from 4396d59 to 9f73dd5 Compare April 18, 2023 17:41
- 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.
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.

2 participants