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

Disable backpack climb check for non-player soldiers #117

Merged
merged 1 commit into from
Jan 28, 2023

Conversation

rftrdev
Copy link
Contributor

@rftrdev rftrdev commented Jan 27, 2023

Also get rid of a bit of copy-paste code

@rftrdev rftrdev requested a review from Asdow January 27, 2023 08:11
@rftrdev rftrdev linked an issue Jan 27, 2023 that may be closed by this pull request
Copy link
Contributor

@majcosta majcosta left a comment

Choose a reason for hiding this comment

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

nice

fNonFenceJumper = !( IS_MERC_BODY_TYPE( s ) ) || (UsingNewInventorySystem() == true && s->inv[BPACKPOCKPOS].exists() == true
&& ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)s->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[s->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb)
&& ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[s->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE)));//Moa: added backpack check
fNonFenceJumper = !( IS_MERC_BODY_TYPE( s ) ) || (!s->CanClimbWithCurrentBackpack());//Moa: added backpack check
Copy link
Contributor

@majcosta majcosta Jan 27, 2023

Choose a reason for hiding this comment

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

maybe change to isFenceJumper = IS_MERC_BODY_TYPE( s ) && s->CanClimbWithCurrentBackpack();? naming a variable for a negation seems like twice the cognitive load.

edit: out of scope, obvs

@rftrdev rftrdev merged commit b5ec955 into 1dot13:master Jan 28, 2023
@rftrdev rftrdev deleted the backpack-fix branch January 28, 2023 01:56
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.

AI pathing doesn't handle rooftops properly when wearing backpack
3 participants