-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 impassable broken vehicle parts #70560
Conversation
Slightly unrelated to this change, but the cramped_space effect is applied incorrectly for monsters. You're doing it in Also note that it's probably not worth spending a lot of time on this, since I'm rewriting the pathfinder anyways: #70274 - I still need to integrate your changes into it. |
Thanks! I moved it to move_to and it seems like it's working properly. |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
} | ||
// Check all of this here to ensure the player can't sit in a comfortable seat and then drop 50 liters of junk in their own lap. | ||
if( in_vehicle ) { | ||
if( has_effect( effect_cramped_space ) ) { |
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.
The condition of the if block at line 10943 becomes always false
after your change at this line, right?
Line 10943:
if( !has_effect( effect_cramped_space ) ) {
add_effect( effect_cramped_space, 2_turns, 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.
Oh, it looks like you're right. That shouldn't cause any problems but it should be removed.
@@ -10948,15 +10944,16 @@ void Character::process_effects() | |||
add_effect( effect_cramped_space, 2_turns, true ); | |||
} | |||
is_cramped_space = true; | |||
return; |
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.
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 don't, and they probably do. I didn't realize I was re-introducing the bug.
This reverts commit bef30a5.
Summary
Bugfixes "Fix impassable broken vehicle parts"
Purpose of change
fixes #70555
fixes #70564
Vehicle part passability wasn't properly checking for whether certain parts were or were not broken when deciding whether to see if you could move through them. This was my fault!
Describe the solution
The check for free cargo space is now bypassed if the part is broken (it can't hold anything if it's broken and shouldn't obstruct anyone based on its contents). The check for cargo_passable also still runs if the part is broken.
Also adjusts some vehicle part sizes that I missed.
Describe alternatives you've considered
We could do more in-depth checks on broken parts. Right now they just get a pass as the game sets their capacity to 0 ml which skips the passability check. This allows IE a hulk to smash its way into a car without having to completely delete the tile, though said hulk will still get the cramped space debuff since it's huge. The bucket seat is no longer obstructing the space, but you're still cramming yourself in a too-small vehicle. IMO that makes enough sense that we shouldn't worry about it, but it could be made more granular in the future if desired.
Testing
Additional context