1
This commit is contained in:
parent
20a73e64b4
commit
d3674779c2
@ -1663,7 +1663,7 @@ void Human::AddItem(int item_id, int item_num)
|
||||
#endif
|
||||
if (IsPlayer()) {
|
||||
cs::SMGetItemNotify notify_msg;
|
||||
auto pair = notify_msg.add_items();
|
||||
auto pair = notify_msg.add_old_items();
|
||||
pair->set_key(item_id);
|
||||
pair->set_value(item_num);
|
||||
SendNotifyMsg(notify_msg);
|
||||
|
@ -671,7 +671,7 @@ void Player::ProcInteraction()
|
||||
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) {
|
||||
auto pair = notify_msg.mutable_items(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;
|
||||
@ -679,7 +679,7 @@ void Player::ProcInteraction()
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
auto pair = notify_msg.add_items();
|
||||
auto pair = notify_msg.add_old_items();
|
||||
pair->set_key(loot->item_id);
|
||||
pair->set_value(real_get_count);
|
||||
}
|
||||
|
@ -1735,7 +1735,8 @@ message SMMatchMemberMsgNotify
|
||||
//获得物品
|
||||
message SMGetItemNotify
|
||||
{
|
||||
repeated MFPair items = 8; //key:道具id value:数量
|
||||
repeated MFPair old_items = 8; //key:道具id value:数量
|
||||
repeated MFTuple items = 1; //0道具id 1:数量 2:当前数量
|
||||
}
|
||||
|
||||
//通过了这一波
|
||||
|
Loading…
x
Reference in New Issue
Block a user