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: folding vehicles fold up into proper item #5845

Merged
merged 3 commits into from
Dec 28, 2024

Conversation

shmakota
Copy link
Contributor

@shmakota shmakota commented Dec 28, 2024

Checklist

Required

Optional

Purpose of change

Allows folding a vehicle to work (presumably) as intended, and return the specified item. Previously, if someone added a new item "skateboard" and refolded it after placing it down, it would return a folding_bicycle item. Now it will return the "skateboard" item. Also changes name of the folding wheelchair, and the way folding vehicle names are created. Previously it would fold into "folded Folding wheelchair" now just into "wheelchair."

Describe the solution

Unhardcode the string "folding_bicycle" and make it return itype_id instead when specifying the folding_veh_item.

Describe alternatives you've considered

Testing

Spawned unicycle and wheelchair, they work as expected upon folding/unfolding. Spawned a folding_bicycle item, works as expected. Created a test item folding_flatbed which unfolds into a flatbed truck, and upon it being refolded it correctly returns the folding_flatbed.

Additional context

@github-actions github-actions bot added src changes related to source code. JSON related to game datas in JSON format. labels Dec 28, 2024
@yay855
Copy link
Collaborator

yay855 commented Dec 28, 2024

Looks good; I'll test it myself once the checks come through, but it should work easily enough.

Copy link
Collaborator

@RobbieNeko RobbieNeko left a comment

Choose a reason for hiding this comment

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

Builds on my machine (Linux)!
Tested folding bike and wheelchair, both indeed behave as expected!
image

@RoyalFox2140
Copy link
Collaborator

What are you, lurking in the dev chat secretly?
image
image

@RobbieNeko
Copy link
Collaborator

Checks passed, now for confirmation that it doesn't magically bork itself on Windows since this is a C++ change ^-^

Copy link
Member

@chaosvolt chaosvolt left a comment

Choose a reason for hiding this comment

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

  1. Compiled and load-tested.
  2. Spawned in a folding bike, deploying it and repacking it causes no odd behaviors.
  3. Redeploying it afterward also seems to work as intended.
  4. Spawned in a wheelchair, it folds up and deploys as expected, still preserves its part damage and ability to modify the item.
  5. Edited folding bike item to spawn a car instead, it...somehow folds up when examined and turns into a folding bicycle again. I only changed what the item spawns when unfolded and not the name or anything, so this is...probably expected behavior?

@RoyalFox2140 RoyalFox2140 merged commit 2088cd2 into cataclysmbnteam:main Dec 28, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JSON related to game datas in JSON format. src changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants