修复换弹逻辑
This commit is contained in:
parent
b24e0e7c1f
commit
34e1dd72ab
@ -2804,3 +2804,14 @@ void Human::ProcSkillPhase(MetaData::SkillPhase* phase)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Human::AutoChgWeapon()
|
||||||
|
{
|
||||||
|
if (weapons[GUN_SLOT1].weapon_idx != 0) {
|
||||||
|
curr_weapon = &weapons[GUN_SLOT1];
|
||||||
|
} else if (weapons[GUN_SLOT2].weapon_idx != 0) {
|
||||||
|
curr_weapon = &weapons[GUN_SLOT2];
|
||||||
|
} else {
|
||||||
|
curr_weapon = &weapons[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -245,6 +245,7 @@ protected:
|
|||||||
void SelectSkillTargets(const a8::Vec2& target_pos, std::set<Entity*>& target_list);
|
void SelectSkillTargets(const a8::Vec2& target_pos, std::set<Entity*>& target_list);
|
||||||
Buff* GetBuffById(int buff_id);
|
Buff* GetBuffById(int buff_id);
|
||||||
void ProcSkillPhase(MetaData::SkillPhase* phase);
|
void ProcSkillPhase(MetaData::SkillPhase* phase);
|
||||||
|
void AutoChgWeapon();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void ClearFrameData();
|
void ClearFrameData();
|
||||||
|
@ -332,6 +332,7 @@ void Player::Shot()
|
|||||||
}
|
}
|
||||||
if (action_type == AT_Reload ||
|
if (action_type == AT_Reload ||
|
||||||
action_type == AT_Rescue ||
|
action_type == AT_Rescue ||
|
||||||
|
action_type == AT_UseItem ||
|
||||||
action_type == AT_Relive) {
|
action_type == AT_Relive) {
|
||||||
CancelAction();
|
CancelAction();
|
||||||
}
|
}
|
||||||
@ -380,6 +381,7 @@ void Player::Shot()
|
|||||||
--curr_weapon->ammo;
|
--curr_weapon->ammo;
|
||||||
}
|
}
|
||||||
int slot_id = curr_weapon->meta->i->_inventory_slot();
|
int slot_id = curr_weapon->meta->i->_inventory_slot();
|
||||||
|
//扔完手雷,如无手雷,则优先换武器1>武器2
|
||||||
switch (slot_id) {
|
switch (slot_id) {
|
||||||
case 5:
|
case 5:
|
||||||
{
|
{
|
||||||
@ -395,7 +397,7 @@ void Player::Shot()
|
|||||||
if (weapons[SMOKE_SLOT].weapon_id != 0) {
|
if (weapons[SMOKE_SLOT].weapon_id != 0) {
|
||||||
curr_weapon = &weapons[SMOKE_SLOT];
|
curr_weapon = &weapons[SMOKE_SLOT];
|
||||||
} else {
|
} else {
|
||||||
curr_weapon = &weapons[0];
|
AutoChgWeapon();
|
||||||
}
|
}
|
||||||
AutoLoadingBullet();
|
AutoLoadingBullet();
|
||||||
}
|
}
|
||||||
@ -418,7 +420,7 @@ void Player::Shot()
|
|||||||
if (weapons[FRAG_SLOT].weapon_id != 0) {
|
if (weapons[FRAG_SLOT].weapon_id != 0) {
|
||||||
curr_weapon = &weapons[FRAG_SLOT];
|
curr_weapon = &weapons[FRAG_SLOT];
|
||||||
} else {
|
} else {
|
||||||
curr_weapon = &weapons[0];
|
AutoChgWeapon();
|
||||||
}
|
}
|
||||||
AutoLoadingBullet();
|
AutoLoadingBullet();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user