This commit is contained in:
aozhiwei 2019-05-15 15:35:47 +08:00
parent 2800019563
commit 75e494b0f7

View File

@ -175,15 +175,18 @@ void Player::UpdateSelectWeapon()
return; return;
} }
if (selected_weapon_idx >= 0 && selected_weapon_idx < weapons.size()) { if (selected_weapon_idx >= 0 && selected_weapon_idx < weapons.size()) {
Weapon* old_weapon = curr_weapon;
Weapon* weapon = &weapons[selected_weapon_idx]; Weapon* weapon = &weapons[selected_weapon_idx];
if (weapon->weapon_id != 0) { if (weapon->weapon_id != 0) {
curr_weapon = weapon; curr_weapon = weapon;
ResetAction(); ResetAction();
need_sync_active_player = true; need_sync_active_player = true;
SyncAroundPlayers(); SyncAroundPlayers();
if (old_weapon != weapon) {
AutoLoadingBullet(); AutoLoadingBullet();
} }
} }
}
select_weapon = false; select_weapon = false;
selected_weapon_idx = 0; selected_weapon_idx = 0;
} }