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 tow cables crashing and not keeping connections properly #71482

Merged
merged 2 commits into from
Feb 5, 2024

Conversation

Kamayana
Copy link
Contributor

@Kamayana Kamayana commented Feb 4, 2024

Summary

Bugfixes "Fix tow cables crashing and not keeping connections properly"

Purpose of change

Fixes #71412. Also fixes tow cables being fully disconnected when you only detach one end - the other end now stays connected, as with other cable links.

Describe the solution

Adds a check for a valid vehicle part, rather than naïvely assuming it'll always be valid. Adjusts the order invalidate_towing handles things so it removes parts and then makes a connection, since tow cables can't be attached to vehicles that already have one.

Describe alternatives you've considered

Tow cables still have a bunch of weird jank to them, but here I just wanted to fix them back to the workable state they were in before.

Testing

Repeated the steps of the linked issue, no problem. Attached a tow cable to two cars in both directions, both worked, cars tow properly. Tried connecting both cable ends to same car, fail as intended. While towing car, map edit a stone wall in between to make sure the cable snaps off as it should; it does.

Additional context

@github-actions github-actions bot added Vehicles Vehicles, parts, mechanics & interactions [C++] Changes (can be) made in C++. Previously named `Code` <Bugfix> This is a fix for a bug (or closes open issue) json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Feb 4, 2024
@Maleclypse Maleclypse merged commit ea08bf0 into CleverRaven:master Feb 5, 2024
24 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions Vehicles Vehicles, parts, mechanics & interactions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Seg Fault upon Connecting Two Vehicles with Tow Cable
2 participants