mirror of
				https://github.com/halpz/re3.git
				synced 2025-11-04 01:37:02 +00:00 
			
		
		
		
	Fix a bug about switching to previous weapon unintendedly
This commit is contained in:
		@@ -729,10 +729,17 @@ CPlayerPed::ProcessWeaponSwitch(CPad *padUsed)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
				for (m_nSelectedWepSlot = m_currentWeapon + 1; m_nSelectedWepSlot < TOTAL_WEAPON_SLOTS; ++m_nSelectedWepSlot) {
 | 
									for (m_nSelectedWepSlot = m_currentWeapon + 1; m_nSelectedWepSlot < TOTAL_WEAPON_SLOTS; ++m_nSelectedWepSlot) {
 | 
				
			||||||
					if (HasWeaponSlot(m_nSelectedWepSlot) && GetWeapon(m_nSelectedWepSlot).HasWeaponAmmoToBeUsed()) {
 | 
										if (HasWeaponSlot(m_nSelectedWepSlot) && GetWeapon(m_nSelectedWepSlot).HasWeaponAmmoToBeUsed()) {
 | 
				
			||||||
 | 
					#ifdef FIX_BUGS
 | 
				
			||||||
 | 
											goto switchDetectDone;
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
						goto spentAmmoCheck;
 | 
											goto spentAmmoCheck;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
				m_nSelectedWepSlot = 0;
 | 
									m_nSelectedWepSlot = 0;
 | 
				
			||||||
 | 
					#ifdef FIX_BUGS
 | 
				
			||||||
 | 
									goto switchDetectDone;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		} else if (padUsed->CycleWeaponLeftJustDown()) {
 | 
							} else if (padUsed->CycleWeaponLeftJustDown()) {
 | 
				
			||||||
			if (TheCamera.PlayerWeaponMode.Mode != CCam::MODE_M16_1STPERSON
 | 
								if (TheCamera.PlayerWeaponMode.Mode != CCam::MODE_M16_1STPERSON
 | 
				
			||||||
@@ -754,6 +761,10 @@ CPlayerPed::ProcessWeaponSwitch(CPad *padUsed)
 | 
				
			|||||||
					
 | 
										
 | 
				
			||||||
					--m_nSelectedWepSlot;
 | 
										--m_nSelectedWepSlot;
 | 
				
			||||||
				} while (m_nSelectedWepSlot != WEAPONSLOT_UNARMED);
 | 
									} while (m_nSelectedWepSlot != WEAPONSLOT_UNARMED);
 | 
				
			||||||
 | 
					#ifdef FIX_BUGS
 | 
				
			||||||
 | 
									goto switchDetectDone;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user