1
This commit is contained in:
parent
d3674779c2
commit
644c1a5c45
@ -31,6 +31,7 @@
|
||||
#include "stats.h"
|
||||
#include "guide.h"
|
||||
#include "mapinstance.h"
|
||||
#include "compose.h"
|
||||
|
||||
#include "mt/Param.h"
|
||||
#include "mt/Equip.h"
|
||||
@ -670,12 +671,47 @@ void Player::ProcInteraction()
|
||||
if (loot->pickuped || loot->count < old_count) {
|
||||
bool real_get_count = loot->count < old_count ? old_count - loot->count : loot->count;
|
||||
bool found = false;
|
||||
for (int i = 0; i < notify_msg.items().size(); ++i) {
|
||||
for (int i = 0; i < notify_msg.old_items().size(); ++i) {
|
||||
auto pair = notify_msg.mutable_old_items(i);
|
||||
if (pair->key() == loot->item_id) {
|
||||
pair->set_value(pair->value() + real_get_count);
|
||||
found = true;
|
||||
break;
|
||||
{
|
||||
if (pair->key() == loot->item_id) {
|
||||
pair->set_value(pair->value() + real_get_count);
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto tuple = notify_msg.add_items();
|
||||
tuple->add_values(loot->item_id);
|
||||
tuple->add_values(pair->value() + real_get_count);
|
||||
int curr_num = 0;
|
||||
if (loot->meta->equip_type() == EQUIP_TYPE_WEAPON) {
|
||||
if (GetCurrWeapon()->weapon_id == loot->meta->id()) {
|
||||
curr_num = GetCompose()->GetNum();
|
||||
}
|
||||
} else if (loot->meta->equip_type() == EQUIP_TYPE_GEMSTONE) {
|
||||
switch (loot->meta->equip_subtype()) {
|
||||
case GEMSTONE_SUB_EQUIP_ENERGY:
|
||||
{
|
||||
curr_num = gemstone;
|
||||
}
|
||||
break;
|
||||
case GEMSTONE_SUB_EQUIP_SKILL:
|
||||
{
|
||||
curr_num = GetInventory(IS_BLUE_STONE);
|
||||
}
|
||||
break;
|
||||
case GEMSTONE_SUB_EQUIP_SHIELD:
|
||||
{
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
tuple->add_values(curr_num);
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user