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

Add Vehicle.IsConsideredDestroyed #1030

Merged

Conversation

kagikn
Copy link
Member

@kagikn kagikn commented Sep 21, 2021

Another simple and useful feature.

Set IsConsideredDestroyed to false in Repair since few people would want
to leave considered destroyed
@crosire
Copy link
Collaborator

crosire commented Sep 21, 2021

Maybe just IsDestroyed?

@kagikn
Copy link
Member Author

kagikn commented Sep 21, 2021

I don’t think IsDestroyed is a appropriate name, because IS_ENTITY_DEAD will always return true if (*(byte*)(CVehicle + 0xD8) & 7) == 3 is true. With memory editing, we can even make exploded vehicles considered not destroyed by the game so peds can enter them.

@kagikn
Copy link
Member Author

kagikn commented Sep 21, 2021

IS_ENTITY_DEAD will also return true if the entity is vehicle and some kind of sinking flag is set (for vehicles sinking for a short time). That flag will be removed when vehicles are not in water though.

@kagikn
Copy link
Member Author

kagikn commented Sep 21, 2021

Oh wait, more convincing fact. Changing the value of (byte*)(CVehicle + 0xD8) does not change if the vehicle is rendered scorched, which can be changed with SET_ENTITY_RENDER_SCORCHED. We can fail missions for vehicles destroyed by changing the value since IS_VEHICLE_DRIVEABLE will return false by doing that on the other hand (even if the vehicles looked completely undamaged).

@kagikn kagikn merged commit 9abf8e6 into scripthookvdotnet:main Sep 21, 2021
@kagikn kagikn deleted the add-vehicle-considered-destroyed branch November 22, 2022 12:19
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.

2 participants