修复手雷拾取自动装备问题
This commit is contained in:
parent
a36d16e5cb
commit
b3d24e827a
@ -68,7 +68,7 @@ const int DEF_HELMET_ID = 12404;
|
|||||||
const int DEF_CHEST_ID = 12401;
|
const int DEF_CHEST_ID = 12401;
|
||||||
const int DEF_WEAPON_ID = 12103;
|
const int DEF_WEAPON_ID = 12103;
|
||||||
|
|
||||||
const int GAS_INACTIVE_TIME = 1;
|
const int GAS_INACTIVE_TIME = 200;
|
||||||
const int SERVER_FRAME_RATE = 20;
|
const int SERVER_FRAME_RATE = 20;
|
||||||
const int SYNC_FRAME_RATE = 10;
|
const int SYNC_FRAME_RATE = 10;
|
||||||
|
|
||||||
|
@ -310,6 +310,15 @@ void Player::LootInteraction(Loot* entity)
|
|||||||
if (item_meta->i->_inventory_slot() >= 0 &&
|
if (item_meta->i->_inventory_slot() >= 0 &&
|
||||||
item_meta->i->_inventory_slot() < MAX_INVENTORY_NUM) {
|
item_meta->i->_inventory_slot() < MAX_INVENTORY_NUM) {
|
||||||
inventory[item_meta->i->_inventory_slot()] += entity->count;
|
inventory[item_meta->i->_inventory_slot()] += entity->count;
|
||||||
|
if (item_meta->i->_inventory_slot() == 5 ||
|
||||||
|
item_meta->i->_inventory_slot() == 6) {
|
||||||
|
Weapon* weapon = &weapons[3 + (item_meta->i->_inventory_slot() - 5)];
|
||||||
|
if (weapon->weapon_id == 0) {
|
||||||
|
weapon->weapon_id = entity->item_id;
|
||||||
|
weapon->weapon_lv = 1;
|
||||||
|
weapon->num = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (item_meta->i->_inventory_slot() > 12) {
|
if (item_meta->i->_inventory_slot() > 12) {
|
||||||
if (item_meta->i->_inventory_slot() - 12 > curr_scope_idx) {
|
if (item_meta->i->_inventory_slot() - 12 > curr_scope_idx) {
|
||||||
curr_scope_idx = item_meta->i->_inventory_slot() - 12;
|
curr_scope_idx = item_meta->i->_inventory_slot() - 12;
|
||||||
|
@ -409,6 +409,13 @@ void Room::ProcAddedObjects()
|
|||||||
moveable_hash_[pair.second->entity_uniid] = pair.second;
|
moveable_hash_[pair.second->entity_uniid] = pair.second;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case ET_Smoke:
|
||||||
|
{
|
||||||
|
for (auto& pair : human_hash_) {
|
||||||
|
pair.second->new_objects.insert(pair.second);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
abort();
|
abort();
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user