This commit is contained in:
aozhiwei 2019-04-02 17:33:39 +08:00
parent 3f80cd943f
commit da73768204
3 changed files with 15 additions and 1 deletions

View File

@ -72,7 +72,7 @@ const int GAS_INACTIVE_TIME = 1;
const int SERVER_FRAME_RATE = 20;
const int SYNC_FRAME_RATE = 10;
const int MAX_INVENTORY_NUM = 14;
const int MAX_INVENTORY_NUM = 17;
const int MAX_WEAPON_NUM = 5;
const int GUN_SLOT1 = 1;

View File

@ -91,6 +91,11 @@ private:
}
for (auto& meta : equip_meta_list) {
if (meta.inventory_slot().empty()) {
meta.set__inventory_slot(-1);
} else {
meta.set__inventory_slot(a8::XValue(meta.inventory_slot()));
}
MetaData::Equip& item = a8::FastAppend(equip_list);
item.i = &meta;
equip_hash[item.i->id()] = &item;

View File

@ -305,6 +305,15 @@ void Player::LootInteraction(Loot* entity)
}
}
break;
default:
{
if (item_meta->i->_inventory_slot() >= 0 &&
item_meta->i->_inventory_slot() < MAX_INVENTORY_NUM) {
inventory[item_meta->i->_inventory_slot()] += entity->count;
need_sync_active_player = true;
}
}
break;
}
entity->pickuped = true;
room->AddDeletedObject(entity->entity_uniid);