添加弹夹
This commit is contained in:
parent
2b1f0e29cf
commit
03e08e46e9
@ -19,6 +19,7 @@ void Weapon::ToPB(cs::MFWeapon* pb_obj)
|
|||||||
pb_obj->set_weapon_id(weapon_id);
|
pb_obj->set_weapon_id(weapon_id);
|
||||||
pb_obj->set_weapon_lv(weapon_lv);
|
pb_obj->set_weapon_lv(weapon_lv);
|
||||||
pb_obj->set_ammo(ammo);
|
pb_obj->set_ammo(ammo);
|
||||||
|
pb_obj->set_volume(GetClipVolume());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Weapon::Recalc()
|
void Weapon::Recalc()
|
||||||
@ -29,12 +30,7 @@ void Weapon::Recalc()
|
|||||||
|
|
||||||
int Weapon::GetClipVolume()
|
int Weapon::GetClipVolume()
|
||||||
{
|
{
|
||||||
if (upgrade_meta) {
|
return GetAttrValue(kHAT_Volume);
|
||||||
return meta->i->clip_volume() +
|
|
||||||
upgrade_meta->GetAttrValue(weapon_lv, kHAT_Volume);
|
|
||||||
} else {
|
|
||||||
return meta->i->clip_volume();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float Weapon::GetAttrValue(HumanAttrType_e attr_type)
|
float Weapon::GetAttrValue(HumanAttrType_e attr_type)
|
||||||
|
@ -201,6 +201,7 @@ message MFWeapon
|
|||||||
optional int32 weapon_id = 1; //武器id 当weapon_id == 0时表示无装备(装备位置显示空)
|
optional int32 weapon_id = 1; //武器id 当weapon_id == 0时表示无装备(装备位置显示空)
|
||||||
optional int32 weapon_lv = 2; //武器等级
|
optional int32 weapon_lv = 2; //武器等级
|
||||||
optional int32 ammo = 4; //弹药数
|
optional int32 ammo = 4; //弹药数
|
||||||
|
optional int32 volume = 5; //弹夹容量
|
||||||
}
|
}
|
||||||
|
|
||||||
//皮肤
|
//皮肤
|
||||||
|
Loading…
x
Reference in New Issue
Block a user