This commit is contained in:
aozhiwei 2021-04-02 16:31:45 +08:00
parent 7efc9e6d2c
commit 871e44508f
3 changed files with 15 additions and 11 deletions

View File

@ -89,8 +89,6 @@ enum InventorySlot_e
IS_SMOKE = 6,
IS_HEALTHKIT = 7, //医疗包
IS_PAIN_KILLER = 8, //止痛药
IS_POSION_GAS_BOMB = 9,
IS_MOLOTOR_COCKTAIL = 10,
IS_1XSCOPE = 12,
IS_2XSCOPE = 13,
@ -98,6 +96,11 @@ enum InventorySlot_e
IS_8XSCOPE = 15,
IS_15XSCOPE = 16,
IS_POSION_GAS_BOMB = 17, //毒气弹
IS_MOLOTOR_COCKTAIL = 18, //燃烧瓶
IS_TRAP = 19, //陷井
IS_MINE = 20, //地雷
IS_END
};
@ -368,7 +371,7 @@ const int SERVER_FRAME_RATE = 20;
const int SYNC_FRAME_RATE = 10;
const float FRAME_RATE_MS = 1000.0f / SERVER_FRAME_RATE;
const int MAX_WEAPON_NUM = 5;
const int MAX_WEAPON_NUM = 9;
const int MAX_SKIN_LV = 9;
const int GUN_SLOT1 = 1;

View File

@ -76,6 +76,15 @@ void InternalShot(Creature* c,
Creature::Creature():MoveableEntity()
{
weapons.reserve(MAX_WEAPON_NUM);
for (size_t i = 0; i < MAX_WEAPON_NUM; ++i) {
auto& weapon = a8::FastAppend(weapons);
weapon.weapon_idx = i;
weapon.weapon_id = 0;
weapon.weapon_lv = 0;
weapon.ammo = 0;
}
weak_ptr_chunk_.Set(this);
inventory_[IS_1XSCOPE] = 1;

View File

@ -43,14 +43,6 @@ Human::Human():Creature()
default_weapon.ammo = 1;
default_weapon.meta = MetaMgr::Instance()->GetEquip(default_weapon.weapon_id);
default_weapon.Recalc();
weapons.reserve(MAX_WEAPON_NUM);
for (size_t i = 0; i < MAX_WEAPON_NUM; ++i) {
auto& weapon = a8::FastAppend(weapons);
weapon.weapon_idx = i;
weapon.weapon_id = 0;
weapon.weapon_lv = 0;
weapon.ammo = 0;
}
for (int i = 0; i < kSkinNum; ++i) {
Skin& skin = a8::FastAppend(skins);
skin.skin_id = 0;