diff --git a/server/gameserver/player.cc b/server/gameserver/player.cc index d7c5c535..0a1229c0 100644 --- a/server/gameserver/player.cc +++ b/server/gameserver/player.cc @@ -263,8 +263,7 @@ void Player::UpdateMoving() if (action_type == AT_Relive) { CancelAction(); } - if (dead || - room->IsWaitingStart()) { + if (dead) { moving = false; moved_frames = 0; return; @@ -314,7 +313,6 @@ void Player::UpdateShot() { if (dead || downed || - room->IsWaitingStart() || HasBuffEffect(kBET_Jump) || HasBuffEffect(kBET_Fly)) { shot_start = false; diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index ef23a4c8..91041fb6 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -2230,16 +2230,6 @@ void Room::NotifyGameStart() 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 (mt::Param::GetIntParam("prepare_time", 3000) / FRAME_RATE_MS, [this] (int event, const a8::Args* args) @@ -3861,3 +3851,8 @@ bool Room::IsSandTableRoom() !IsNewBieRoom() && SupportSandTable(); } + +bool Room::HasRoomSwitch(int tag) +{ + return a8::HasBitFlag(room_switch_, tag); +} diff --git a/server/gameserver/room.h b/server/gameserver/room.h index 104b4fd0..2e94eb36 100644 --- a/server/gameserver/room.h +++ b/server/gameserver/room.h @@ -51,6 +51,13 @@ struct CarObject bool taken = false; }; +enum RoomSwitch_e +{ + kRoomSwitchDisableMove = 0, + kRoomSwitchDisableUseSkill, + kRoomSwitchDisableUseItem, +}; + typedef void (*FrameCallCb)(void*); struct FrameCallNode; class MatchTeam; @@ -101,7 +108,6 @@ public: int GetRoomIdx() { return room_idx_; } std::string GetMapTplName() { return map_tpl_name_; } const mt::Map* GetMapMeta() { return map_meta_; } - bool IsWaitingStart() { return waiting_start_; } bool IsBattleStarting() { return battle_starting_; }; bool IsPveRoom(); bool IsDestoryRoom(); @@ -241,6 +247,7 @@ public: void LockRoom() { lock_room_ = true; } void CombineTeam(); void FillTeam(); + bool HasRoomSwitch(int tag); private: void ShuaAndroid(); @@ -336,7 +343,6 @@ private: std::string map_tpl_name_; RoomType_e room_type_ = RT_NewBrid; - bool waiting_start_ = false; GasData gas_data_; long long frameno_ = 0; long long battle_start_frameno_ = 0; @@ -401,6 +407,8 @@ private: bool force_over_ = false; bool lock_room_ = false; + long long room_switch_ = 0; + friend class Incubator; friend class Team; };