-
-
Notifications
You must be signed in to change notification settings - Fork 438
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 new glitch (don't burn flipped cars) #2369
Add new glitch (don't burn flipped cars) #2369
Conversation
Out of curiousity, how does the sync work? |
good question |
Yes, it would start burning for the player that has this feature set to Normally it should be used for example in onClientResourceStart event. At least, this is intended usage and i don't see any reason someone would like to do it differently. I also don't see any need to make it sever side with extensive sync handling and essentially vehicle specific. Making it work this way would require hooking several functions with additional logic (completely unnecessary complications). |
Agreed. Would it be difficult to make unoccupied and ped occupied vehicles ignite when flipped? |
You mean by patching the game itself or using Lua? Because it could be done using Lua easily and more. This is what i had in mind for this feature:
I use similar approach right now to prevent vehicles from burning flipped (rotation check + setVehicleDamageProof). The downside of this approach is that it makes the vehicle invincible (it could be solved using custom damage system tho). This new property essentially replacing this whole system without any additional changes in my case. The game could be patched to handle occupied and unoccupied flipped vehicles differently. But i think there is no need to do it since we will have full control over it with Lua anyway. |
Yeah I meant patching the game, but your approach makes sense, so I agree there's no need |
Cool feature. Works for me. |
Yeah, it would be nice to merge it. As soon as someone reviews it (should be easy). |
code looks good for me. |
We tested this feature, and this works fine for one player, but in situation with several players, it need to be turned to all i suppose. I can say that it is strange behavior, but |
This feature works only when all players on server have it enabled. Also there is a race condition. When player download server resources, he can burn vehicles in sync distance. I think, it should be serverside function. You should send flag |
This is exactly how I saw it used. It was discussed earlier in the conversation.
This edge case can be easily avoided using
I personally think that it's completely unnecessary. But if this is the only way for it to be merged then maybe someone will be interested in implementing server side function. I'm not gonna be able to do this anytime soon. |
Yeah, i know about it, but default camera position can still trigger this issue. |
I guess we could use setGlitchEnabled for this instead of adding new functions. Something like "dontburnflippedcars". Not sure about the name. |
I think the point about race condition trigger is valid and hence would be necessary to implement a server synchronized setting for this before merging. |
…r46/mtasa-blue into feature/prop-burnflippedcars
Function changed to setGlitchEnabled ("dontburnflippedcars") |
@samr46 Please update the wiki page for glitches. |
I like the idea of making this feature toggleable through server functions, but shoehorning it into How feasible would it be to move it to |
@AlexTMjugador That sounds right. It's time to add |
Alright! @samr46, would you like to file a separate PR for that? I wish I had reviewed this before the merge, but I didn't notice the change to use |
Please don't bother, I am already working on that. |
Just created new branch 😂 |
…ultitheftauto#2369)" This reverts commit 21ffd15. The changes will re-introduced in a short while.
@samr46 Sorry for this, but can you do it instead? |
Yes, I will send new PR ~ tomorrow. |
Solves #1076
Adds new property "dontburnflippedcars" to functions: setGlitchEnabled, isGlitchEnabled.
Default:
false
(cars start to burn when upside down) (current behavior)If set to
true
then cars will not start to burn when upside down.It doesn't affect any other vehicle health related behavior. The vehicles can be damaged and health can be changed using setElementHealth. Will be useful to make specific vehicles burn upside down if needed.
Test resource: burnflippedcars.zip (there is README.txt inside with some notes and suggestions about testing)
UPDATE 2023-04-09: Current test resource is partially outdated. Function switched to setGlitchEnabled.