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(vehicle): fix repair not working after going in water #2996

Merged
merged 5 commits into from May 1, 2024

Conversation

xiaoxiao921
Copy link
Member

Closes #2995

It's a bandaid fix but it works, there are multiple issues though. First person can't be used anymore in that specific vehicle, and can't be rentered. I tried messing with the vehicle flags and physical flags without any success sadly.

Copy link

github-actions bot commented Apr 29, 2024

Download the artifacts for this pull request:

Copy link
Contributor

@gir489returns gir489returns left a comment

Choose a reason for hiding this comment

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

I exclusively play in FPV, this fix is not acceptable to me as the original ticket submitter.

Copy link
Contributor

@gir489returns gir489returns left a comment

Choose a reason for hiding this comment

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

Tested and working, but...

src/util/vehicle.cpp Outdated Show resolved Hide resolved
src/util/vehicle.cpp Outdated Show resolved Hide resolved
src/util/vehicle.cpp Outdated Show resolved Hide resolved
@rkwapisz
Copy link
Contributor

rkwapisz commented Apr 30, 2024

@xiaoxiao921 nailed it with the 0xD8 offset. Well done.
private int _oVState = 0xD8; // int 0:Player 1:NPC 2:Unused 3:Destroyed

Don't need anything else after that besides VEHICLE::SET_VEHICLE_FIXED(veh)

@rkwapisz
Copy link
Contributor

rkwapisz commented Apr 30, 2024

I think this concept could be easily expanded to repairs from any sort of destructive event such as explosions. Would be handy since a lot of mod menus can just explode your vehicle, and not everyone likes playing with godmode.

If vehicle repair can be refactored to remember the player's last vehicle (like we can with GET_VEHICLE_PED_IS_IN(ped, lastVehicle = true), then the vehicle could be repaired even without the player having to physically be inside it. The bitmask could probably work for that case as well to recover the vehicle from any destroyed state, including a smouldering heap.

Then repair_engine_from_water could be renamed as something like repair_destroyed_vehicle. Would be great to be able to quickly repair a vehicle that was destroyed via explosion griefing without having to recall it from the PV list or call Mors.

@Yimura Yimura merged commit 435963d into YimMenu:master May 1, 2024
1 check passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Vehicle -> Repair does not fix cars that been in water.
4 participants