Skip to content

Fix jetpack behavior#4804

Merged
Lpsd merged 2 commits intomultitheftauto:masterfrom
FileEX:bugfix/jetpack_behaviour
Apr 14, 2026
Merged

Fix jetpack behavior#4804
Lpsd merged 2 commits intomultitheftauto:masterfrom
FileEX:bugfix/jetpack_behaviour

Conversation

@FileEX
Copy link
Copy Markdown
Member

@FileEX FileEX commented Apr 13, 2026

Summary

In GTA, when you equip a jetpack, the weapon is automatically switched to a pistol, tec-9, or uzi if you have one of these weapons. Otherwise, the weapon is hidden from the player’s hands, but the slot remains unchanged, which causes two issues:

In GTA, when you remove the jetpack, the slot is restored to the one you had before equipping it. For example, if you are holding an AK-47, then equip a jetpack and it switches to an uzi, after removing the jetpack you get the AK-47 back. PR #3573 changed this behavior so that after removing the jetpack, the slot is always reset to 0.

From the GTA code, it appears that Rockstar also intended to include the sawed-off shotgun for jetpack use, but a trivial mistake prevented it from working.

			// this is to let the player use other 1 handed weapons when flying a jetpack!
			else if(nVehicleType==1 && m_WeaponSlots[WEAPONSLOT_TYPE_SHOTGUN].m_eWeaponType==WEAPONTYPE_SAWNOFF_SHOTGUN
			&& m_WeaponSlots[WEAPONSLOT_TYPE_SHOTGUN].m_nAmmoTotal>0)
			{
				nDoDrivebySlot = WEAPONSLOT_TYPE_HANDGUN;
			}
			else if(nVehicleType==1 && m_WeaponSlots[WEAPONSLOT_TYPE_HANDGUN].m_eWeaponType==WEAPONTYPE_PISTOL
			&& m_WeaponSlots[WEAPONSLOT_TYPE_HANDGUN].m_nAmmoTotal>0)
			{
				nDoDrivebySlot = WEAPONSLOT_TYPE_HANDGUN;
			}

This PR resolves the issues described above.

Motivation

#3510 (comment)

Test plan

See issues: #508, #3659

  1. Get chainsaw
  2. Get jetpack
  3. Remove jetpack
  4. The slot should be reset to the chainsaw, but it is instead reset to 0.

TL;DR

  • Removing the jetpack restores the previous slot, exactly like in GTA:SA
  • While using a jetpack, you can now also use the sawed-off shotgun in addition to pistol, Uzi, and Tec-9

Checklist

  • Your code should follow the coding guidelines.
  • Smaller pull requests are easier to review. If your pull request is beefy, your pull request should be reviewable commit-by-commit.

@FileEX FileEX added the bugfix Solution to a bug of any kind label Apr 13, 2026
@Lpsd
Copy link
Copy Markdown
Member

Lpsd commented Apr 14, 2026

The proposed solution in #3510 (comment) sounds good - how come this wasn't implemented?

@FileEX
Copy link
Copy Markdown
Member Author

FileEX commented Apr 14, 2026

The proposed solution in #3510 (comment) sounds good - how come this wasn't implemented?

Due to the ongoing feature freeze, I want to do this in a separate PR so that the bugfix one doesn’t sit indefinitely just because it adds a new feature.

@Lpsd Lpsd merged commit df6119e into multitheftauto:master Apr 14, 2026
10 checks passed
@FileEX FileEX deleted the bugfix/jetpack_behaviour branch April 14, 2026 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Solution to a bug of any kind

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants