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 strip on wearable #143

Merged
merged 3 commits into from
Nov 27, 2023
Merged

Fix strip on wearable #143

merged 3 commits into from
Nov 27, 2023

Conversation

M60TM
Copy link
Contributor

@M60TM M60TM commented Nov 26, 2023

  • Wearable like tf_wearable_demo_shield cannot stripped by current method.
  • So set m_bOnlyIterateItemViewAttributes to true instead. There won't be any problem using this method for wearable.

Using ff2r's strip option(Attributes mean dmg taken from fire reduced and dmg taken from blast reduced)
image

Using cwx's keep_static_attrs(strip) option(It use m_bOnlyIterateItemViewAttributes)
image

- Wearable like `tf_wearable_demo_shield` cannot stripped by current method.
- So set `m_bOnlyIterateItemViewAttributes` to true instead. There won't be any problem using this method for wearables.
{
char classname[36];
GetEntityClassname(entity, classname, sizeof(classname));
if(!StrContains(classname, "tf_wearable"))
Copy link
Owner

Choose a reason for hiding this comment

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

I recommend checking against tf_weapon instead (because tf_powerup_bottle exists)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I forgot that. I changed checking.

{
char classname[36];
GetEntityClassname(entity, classname, sizeof(classname));
if(StrContains(classname, "tf_weapon"))
Copy link
Owner

Choose a reason for hiding this comment

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

This will cause it do the reserve as StrContains returns -1 with no matches and returns 0 when the string starts with the match.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm sorry. I fixed it.

@Batfoxkid Batfoxkid merged commit 32af8c1 into Batfoxkid:main Nov 27, 2023
1 of 2 checks passed
@M60TM M60TM deleted the strip-wearable branch November 12, 2024 10:00
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