This commit is contained in:
aozhiwei 2023-05-19 17:16:23 +08:00
parent ca43643bf3
commit 53a68849a0
3 changed files with 16 additions and 15 deletions

View File

@ -263,8 +263,7 @@ void Player::UpdateMoving()
if (action_type == AT_Relive) { if (action_type == AT_Relive) {
CancelAction(); CancelAction();
} }
if (dead || if (dead) {
room->IsWaitingStart()) {
moving = false; moving = false;
moved_frames = 0; moved_frames = 0;
return; return;
@ -314,7 +313,6 @@ void Player::UpdateShot()
{ {
if (dead || if (dead ||
downed || downed ||
room->IsWaitingStart() ||
HasBuffEffect(kBET_Jump) || HasBuffEffect(kBET_Jump) ||
HasBuffEffect(kBET_Fly)) { HasBuffEffect(kBET_Fly)) {
shot_start = false; shot_start = false;

View File

@ -2230,16 +2230,6 @@ void Room::NotifyGameStart()
a8::SetBitFlag(pair.second->status, CS_DisableAttack); a8::SetBitFlag(pair.second->status, CS_DisableAttack);
} }
waiting_start_ = true;
xtimer.SetTimeoutEx
(SERVER_FRAME_RATE * 2,
[this] (int event, const a8::Args* args)
{
if (a8::TIMER_EXEC_EVENT == event) {
waiting_start_ = false;
}
},
&xtimer_attacher_);
xtimer.SetTimeoutEx xtimer.SetTimeoutEx
(mt::Param::GetIntParam("prepare_time", 3000) / FRAME_RATE_MS, (mt::Param::GetIntParam("prepare_time", 3000) / FRAME_RATE_MS,
[this] (int event, const a8::Args* args) [this] (int event, const a8::Args* args)
@ -3861,3 +3851,8 @@ bool Room::IsSandTableRoom()
!IsNewBieRoom() && !IsNewBieRoom() &&
SupportSandTable(); SupportSandTable();
} }
bool Room::HasRoomSwitch(int tag)
{
return a8::HasBitFlag(room_switch_, tag);
}

View File

@ -51,6 +51,13 @@ struct CarObject
bool taken = false; bool taken = false;
}; };
enum RoomSwitch_e
{
kRoomSwitchDisableMove = 0,
kRoomSwitchDisableUseSkill,
kRoomSwitchDisableUseItem,
};
typedef void (*FrameCallCb)(void*); typedef void (*FrameCallCb)(void*);
struct FrameCallNode; struct FrameCallNode;
class MatchTeam; class MatchTeam;
@ -101,7 +108,6 @@ public:
int GetRoomIdx() { return room_idx_; } int GetRoomIdx() { return room_idx_; }
std::string GetMapTplName() { return map_tpl_name_; } std::string GetMapTplName() { return map_tpl_name_; }
const mt::Map* GetMapMeta() { return map_meta_; } const mt::Map* GetMapMeta() { return map_meta_; }
bool IsWaitingStart() { return waiting_start_; }
bool IsBattleStarting() { return battle_starting_; }; bool IsBattleStarting() { return battle_starting_; };
bool IsPveRoom(); bool IsPveRoom();
bool IsDestoryRoom(); bool IsDestoryRoom();
@ -241,6 +247,7 @@ public:
void LockRoom() { lock_room_ = true; } void LockRoom() { lock_room_ = true; }
void CombineTeam(); void CombineTeam();
void FillTeam(); void FillTeam();
bool HasRoomSwitch(int tag);
private: private:
void ShuaAndroid(); void ShuaAndroid();
@ -336,7 +343,6 @@ private:
std::string map_tpl_name_; std::string map_tpl_name_;
RoomType_e room_type_ = RT_NewBrid; RoomType_e room_type_ = RT_NewBrid;
bool waiting_start_ = false;
GasData gas_data_; GasData gas_data_;
long long frameno_ = 0; long long frameno_ = 0;
long long battle_start_frameno_ = 0; long long battle_start_frameno_ = 0;
@ -401,6 +407,8 @@ private:
bool force_over_ = false; bool force_over_ = false;
bool lock_room_ = false; bool lock_room_ = false;
long long room_switch_ = 0;
friend class Incubator; friend class Incubator;
friend class Team; friend class Team;
}; };