1
This commit is contained in:
parent
5431630556
commit
cf5be3c47f
@ -1012,10 +1012,15 @@ void Creature::ProcBuffEffect(Creature* caster, Buff* buff)
|
||||
break;
|
||||
case kBET_AddInventory:
|
||||
{
|
||||
if (IsValidSlotId(buff->meta->int_param1)) {
|
||||
buff_inventory_[buff->meta->int_param1].num += buff->meta->int_param2;
|
||||
need_sync_active_player = true;
|
||||
for (int slot : buff->meta->param2_int_list) {
|
||||
if (IsValidSlotId(slot)) {
|
||||
buff_inventory_[slot].num += buff->meta->int_param1;
|
||||
}
|
||||
}
|
||||
if (IsHuman()) {
|
||||
AsHuman()->RecalcVolume();
|
||||
}
|
||||
need_sync_active_player = true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -1321,9 +1321,11 @@ void Human::FillMFGasData(cs::MFGasData* gas_data)
|
||||
void Human::RecalcVolume()
|
||||
{
|
||||
MetaData::Equip* backpack_meta = MetaMgr::Instance()->GetEquip(backpack);
|
||||
if (backpack_meta) {
|
||||
for (size_t i = 0; i < backpack_meta->volume.size(); ++i) {
|
||||
volume_[i] = meta->volume[i] + backpack_meta->volume[i];
|
||||
for (size_t i = 0; i < IS_END; ++i) {
|
||||
volume_[i] = meta->volume[i];
|
||||
volume_[i] += buff_inventory_[i].num;
|
||||
if (backpack_meta) {
|
||||
volume_[i] += backpack_meta->volume[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3160,12 +3162,15 @@ void Human::OnBuffRemove(Buff& buff)
|
||||
break;
|
||||
case kBET_AddInventory:
|
||||
{
|
||||
if (IsValidSlotId(buff.meta->int_param1)) {
|
||||
buff_inventory_[buff.meta->int_param1].num -= buff.meta->int_param2;
|
||||
buff_inventory_[buff.meta->int_param1].num =
|
||||
std::max(0, buff_inventory_[buff.meta->int_param1].num);
|
||||
need_sync_active_player = true;
|
||||
for (int slot : buff.meta->param2_int_list) {
|
||||
if (IsValidSlotId(slot)) {
|
||||
buff_inventory_[slot].num -= buff.meta->int_param1;
|
||||
buff_inventory_[slot].num =
|
||||
std::max(0, buff_inventory_[slot].num);
|
||||
}
|
||||
}
|
||||
RecalcVolume();
|
||||
need_sync_active_player = true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -753,7 +753,7 @@ namespace MetaData
|
||||
for (int buff_id : buff_list) {
|
||||
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(buff_id);
|
||||
if (!buff_meta) {
|
||||
#if 1
|
||||
#if 0
|
||||
return;
|
||||
#else
|
||||
abort();
|
||||
@ -809,14 +809,17 @@ namespace MetaData
|
||||
}
|
||||
{
|
||||
std::vector<std::string> strings;
|
||||
a8::Split(i->buff_param2(), strings, ':');
|
||||
a8::Split(i->buff_param2(), strings, '|');
|
||||
if (i->buff_param2().find(":") != std::string::npos) {
|
||||
abort();
|
||||
}
|
||||
for (auto& str : strings) {
|
||||
param2_int_list.push_back(a8::XValue(str).GetInt());
|
||||
}
|
||||
}
|
||||
{
|
||||
std::vector<std::string> strings;
|
||||
a8::Split(i->buff_param3(), strings, ':');
|
||||
a8::Split(i->buff_param3(), strings, '|');
|
||||
for (auto& str : strings) {
|
||||
param3_int_list.push_back(a8::XValue(str).GetInt());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user