1
This commit is contained in:
parent
88bb1919e3
commit
02685a76bc
@ -23,7 +23,7 @@ Human::Human()
|
|||||||
weapon.weapon_idx = i;
|
weapon.weapon_idx = i;
|
||||||
weapon.weapon_id = 0;
|
weapon.weapon_id = 0;
|
||||||
weapon.weapon_lv = 0;
|
weapon.weapon_lv = 0;
|
||||||
weapon.num = 0;
|
weapon.ammo = 0;
|
||||||
}
|
}
|
||||||
weapons[0] = default_weapon;
|
weapons[0] = default_weapon;
|
||||||
curr_weapon = &weapons[0];
|
curr_weapon = &weapons[0];
|
||||||
|
@ -422,8 +422,7 @@ void Player::LootInteraction(Loot* entity)
|
|||||||
weapons[0].weapon_idx = 0;
|
weapons[0].weapon_idx = 0;
|
||||||
weapons[0].weapon_id = entity->item_id;
|
weapons[0].weapon_id = entity->item_id;
|
||||||
weapons[0].weapon_lv = 1;
|
weapons[0].weapon_lv = 1;
|
||||||
weapons[0].num = 0;
|
weapons[0].ammo = entity->count;
|
||||||
weapons[0].ammo = 0;
|
|
||||||
need_sync_active_player = true;
|
need_sync_active_player = true;
|
||||||
}
|
}
|
||||||
need_sync_active_player = true;
|
need_sync_active_player = true;
|
||||||
@ -453,8 +452,7 @@ void Player::LootInteraction(Loot* entity)
|
|||||||
}
|
}
|
||||||
weapon->weapon_id = entity->item_id;
|
weapon->weapon_id = entity->item_id;
|
||||||
weapon->weapon_lv = 1;
|
weapon->weapon_lv = 1;
|
||||||
weapon->num = 0;
|
weapon->ammo = entity->count;
|
||||||
weapon->ammo = 0;
|
|
||||||
weapon->meta = item_meta;
|
weapon->meta = item_meta;
|
||||||
AutoLoadingBullet();
|
AutoLoadingBullet();
|
||||||
need_sync_active_player = true;
|
need_sync_active_player = true;
|
||||||
@ -475,8 +473,7 @@ void Player::LootInteraction(Loot* entity)
|
|||||||
if (weapon->weapon_id == 0) {
|
if (weapon->weapon_id == 0) {
|
||||||
weapon->weapon_id = entity->item_id;
|
weapon->weapon_id = entity->item_id;
|
||||||
weapon->weapon_lv = 1;
|
weapon->weapon_lv = 1;
|
||||||
weapon->num = 0;
|
weapon->ammo = entity->count;
|
||||||
weapon->ammo = 1 ;
|
|
||||||
weapon->meta = item_meta;
|
weapon->meta = item_meta;
|
||||||
inventory[item_meta->i->_inventory_slot()] -= entity->count;
|
inventory[item_meta->i->_inventory_slot()] -= entity->count;
|
||||||
}
|
}
|
||||||
|
@ -123,6 +123,5 @@ 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_num(num);
|
|
||||||
pb_obj->set_ammo(ammo);
|
pb_obj->set_ammo(ammo);
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,6 @@ struct Weapon
|
|||||||
int weapon_idx = 0;
|
int weapon_idx = 0;
|
||||||
int weapon_id = 0;
|
int weapon_id = 0;
|
||||||
int weapon_lv = 0;
|
int weapon_lv = 0;
|
||||||
int num = 0;
|
|
||||||
int ammo = 0;
|
int ammo = 0;
|
||||||
MetaData::Equip* meta = nullptr;
|
MetaData::Equip* meta = nullptr;
|
||||||
|
|
||||||
|
@ -124,7 +124,6 @@ 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 num = 3; //数量 手雷和烟雾弹时该字段有意义
|
|
||||||
optional int32 ammo = 4; //弹药数
|
optional int32 ammo = 4; //弹药数
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user