1
This commit is contained in:
parent
35e0c24822
commit
6cb39117bc
@ -56,6 +56,39 @@ void Player::Initialize()
|
|||||||
&xtimer_attacher.timer_list_);
|
&xtimer_attacher.timer_list_);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
{
|
||||||
|
if (GetCurrWeapon()) {
|
||||||
|
MetaData::Equip* bullet_meta = MetaMgr::Instance()->GetEquip(GetCurrWeapon()->meta->i->use_bullet());
|
||||||
|
if (bullet_meta) {
|
||||||
|
int add_num = GetInventory(bullet_meta->i->_inventory_slot());
|
||||||
|
add_num = GetCurrWeapon()->GetClipVolume();
|
||||||
|
GetCurrWeapon()->ammo = add_num;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (auto& spec_weapon : spec_weapons) {
|
||||||
|
MetaData::Equip* item_meta = MetaMgr::Instance()->GetEquip(spec_weapon.weapon_id);
|
||||||
|
if (item_meta) {
|
||||||
|
if (item_meta->i->equip_subtype() != 1) {
|
||||||
|
int weapon_idx = GUN_SLOT1;
|
||||||
|
if (weapons[weapon_idx].weapon_id != 0) {
|
||||||
|
weapon_idx = GUN_SLOT2;
|
||||||
|
}
|
||||||
|
if (weapons[weapon_idx].weapon_id == 0) {
|
||||||
|
Weapon* weapon = &weapons[weapon_idx];
|
||||||
|
weapon->weapon_uniid = spec_weapon.weapon_uniid;
|
||||||
|
weapon->weapon_idx = weapon_idx;
|
||||||
|
weapon->weapon_id = spec_weapon.weapon_id;
|
||||||
|
weapon->weapon_lv = spec_weapon.weapon_lv;
|
||||||
|
weapon->meta = item_meta;
|
||||||
|
weapon->Recalc();
|
||||||
|
weapon->ammo = weapon->GetClipVolume();
|
||||||
|
SetCurrWeapon(&weapons[GUN_SLOT1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
need_sync_active_player = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::Update(int delta_time)
|
void Player::Update(int delta_time)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user