1
This commit is contained in:
parent
c624a5af94
commit
6aeda0b548
@ -178,7 +178,9 @@ void Buff::ProcBecome(Creature* caster)
|
||||
int weapon_id = a8::XValue(strings[i]);
|
||||
MetaData::Equip* weapon_meta = MetaMgr::Instance()->GetEquip(weapon_id);
|
||||
if (weapon_meta && i < caster->weapons.size()) {
|
||||
Weapon* weapon = &caster->weapons[i];
|
||||
int weapon_idx = weapon_meta->GetWeaponIdx();
|
||||
if (weapon_idx >= 0 && weapon_idx < caster->weapons.size()) {
|
||||
Weapon* weapon = &caster->weapons[weapon_idx];
|
||||
hold_weapons_.push_back(*weapon);
|
||||
|
||||
weapon->weapon_id = weapon_meta->i->id();
|
||||
@ -195,6 +197,7 @@ void Buff::ProcBecome(Creature* caster)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
caster->need_sync_active_player = true;
|
||||
caster->SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||
}
|
||||
|
@ -162,6 +162,19 @@ namespace MetaData
|
||||
}
|
||||
}
|
||||
|
||||
int Equip::GetWeaponIdx()
|
||||
{
|
||||
int weapon_idx = -1;
|
||||
if (i->equip_type() == EQUIP_TYPE_WEAPON) {
|
||||
if (i->equip_subtype() == 1) {
|
||||
return 0;
|
||||
} else {
|
||||
return GUN_SLOT1;
|
||||
}
|
||||
}
|
||||
return weapon_idx;
|
||||
}
|
||||
|
||||
void EquipUpgrade::Init()
|
||||
{
|
||||
const int MAX_LV = 20;
|
||||
|
@ -69,6 +69,7 @@ namespace MetaData
|
||||
float float_param2 = 0;
|
||||
|
||||
void Init();
|
||||
int GetWeaponIdx();
|
||||
};
|
||||
|
||||
struct EquipUpgrade
|
||||
|
Loading…
x
Reference in New Issue
Block a user