multitheftauto / mtasa-blue

Multi Theft Auto is a game engine that incorporates an extendable network play element into a proprietary commercial single-player game.
https://multitheftauto.com
GNU General Public License v3.0
1.37k stars 423 forks source link

Hydra invincibility bug #2795

Open Shivamexe opened 1 year ago

Shivamexe commented 1 year ago

Describe the bug

This bug is limited to the servers having the Heat-Seeking missile system enabled. this bug is triggered by holding the space button(Handbreak bind in settings) which is the default button for locking targets with hydra. It makes the hydra Invincible from any other hydra from taking them down. Whenever a Hydra is a state where it is "looking" for targets to lock on to, It becomes Invincible, until it has locked into some target(3rd video), that's when the Invincibility breaks. This bug can easily be triggered at any point of time by just holding space and not letting the hydra lock onto some target.

Important: -Limited to Heat-Seeking missiles only. -Limited to Hydra vs Hydra only.

Steps to reproduce

  1. 2 hydra pilots.
  2. One of them Holds the space button.
  3. Other one tries to attack it.

Version

Multi Theft Auto v1.5.9-release-21342

Additional context

Holding Space: https://youtu.be/qlrOJIjmyEU

Not holding SPACE: https://youtu.be/9jesbvUAFPw

Invincibility breaks once other target is locked: https://youtu.be/mAB1wldFark

Relevant log output

No response

Security Policy

patrikjuvonen commented 1 year ago

Would be good to have another test with 3 players:

  1. player B flies behind player A
  2. player C flies near player A and B
  3. player C holds the space button but without a target
  4. player B tries to attack player A
  5. What happens?

I guess what I'm trying to rule out is any GTA global state issue, that we can confine the problem to only between the source and target.

MegadreamsBE commented 1 year ago

Would be good to have another test with 3 players:

I'd be up for testing this so feel free to hit me up

Shivamexe commented 1 year ago
  1. What happens?

Anyone holding space near the target or attacker, will make him and the target/attacker invincible. As long as anyone of them locks into something.

Taking the same example- A - Target B - Attacker C - Auxiliary

If A and C are near each other and any one of them is holding space without locking into some target, both of them will remain invincible. Video: https://streamable.com/5cp1gn | https://streamable.com/32tnqv

Another thing I tested was; if A and C are near each other, and C starts moving away from A while holding space, A will still remain invincible as long as C is holding space, no matter how far away they are from each other. Video: https://streamable.com/32ipyv

If there is anything more to test, let me know.

patrikjuvonen commented 1 year ago

Amazing, thank you. This helps a lot.

It is also interesting to see that the projectile models get created, but they disappear right away, this will also help find the problem. I think only based on the test results I would say this is a GTA issue, maybe some sort of a "global condition" that is set under a specific condition like that handbrake or key state, since in PC single player they didn't need to worry about multi player effects so much.

This seems like fun for someone to reverse engineer. I would probably start from 0x6C9260 (CVehicle::ProcessWeapons) which is responsible for launching rockets. I already found that there are some vehicle autopilot CarMission flags that are being read by the game, like "dogfighting against player 0 or player 1". This seems curious and probably related to this issue. There's also 0x737C80 which seems to be probably the one that makes the final decision.

Namely MISSION_PLANE_ATTACK_PLAYER_0 (35), MISSION_PLANE_ATTACK_PLAYER_1 (59), MISSION_PLANE_DOGFIGHT_AGAINST_PLAYER (63)