1
This commit is contained in:
parent
a8e2bd0d47
commit
2ea0a2657d
@ -35,6 +35,7 @@
|
||||
#include "mapinstance.h"
|
||||
#include "debugcmd.h"
|
||||
#include "netdata.h"
|
||||
#include "bag.h"
|
||||
|
||||
#include "mt/Param.h"
|
||||
#include "mt/Equip.h"
|
||||
@ -276,6 +277,9 @@ void Player::InternalUpdate(int delta_time)
|
||||
if (use_item) {
|
||||
UpdateUseItemIdx();
|
||||
}
|
||||
if (has_use_bag_item_id) {
|
||||
UpdateBagUseItemId();
|
||||
}
|
||||
if (action_type != AT_None) {
|
||||
UpdateAction();
|
||||
}
|
||||
@ -601,6 +605,13 @@ void Player::UpdateUseItemId()
|
||||
MarkSyncActivePlayer(__FILE__, __LINE__, __func__);
|
||||
}
|
||||
|
||||
void Player::UpdateBagUseItemId()
|
||||
{
|
||||
GetBag()->UseItem(use_bag_item_id);
|
||||
use_bag_item_id = 0;
|
||||
has_use_bag_item_id = false;
|
||||
}
|
||||
|
||||
void Player::UpdateSpectate()
|
||||
{
|
||||
if (room->GetGasData().GetGasMode() == GasInactive ||
|
||||
@ -1239,9 +1250,13 @@ void Player::_CMMove(f8::MsgHdr* hdr, const cs::CMMove& msg)
|
||||
use_item = true;
|
||||
use_item_idx = msg.use_item_idx();
|
||||
}
|
||||
if (msg.has_use_item_id()) {
|
||||
has_use_item_id = true;
|
||||
use_item_id = msg.use_item_id();
|
||||
if (msg.has_use_item_idx()) {
|
||||
use_item = true;
|
||||
use_item_idx = msg.use_item_idx();
|
||||
}
|
||||
if (msg.has_use_bag_item_id()) {
|
||||
has_use_bag_item_id = true;
|
||||
use_bag_item_id = msg.use_bag_item_id();
|
||||
}
|
||||
if (msg.has_spectate()) {
|
||||
spectate = true;
|
||||
|
@ -62,7 +62,7 @@ class Player : public Human
|
||||
bool use_item = false;
|
||||
int use_item_idx = 0;
|
||||
|
||||
bool use_bag_item = false;
|
||||
bool has_use_bag_item_id = false;
|
||||
int use_bag_item_id = 0;
|
||||
|
||||
bool has_use_item_id = false;
|
||||
@ -113,6 +113,7 @@ class Player : public Human
|
||||
void UpdateCancelAction();
|
||||
void UpdateUseItemIdx();
|
||||
void UpdateUseItemId();
|
||||
void UpdateBagUseItemId();
|
||||
void UpdateSpectate();
|
||||
void UpdateEmote();
|
||||
void UpdateJump();
|
||||
|
Loading…
x
Reference in New Issue
Block a user