This commit is contained in:
aozhiwei 2021-08-20 06:06:59 +00:00
parent 121cf90825
commit b613141b89
4 changed files with 16 additions and 2 deletions

View File

@ -11,6 +11,9 @@ private:
friend class a8::Singleton<App>;
public:
#ifdef DEBUG
std::map<int, int> debug_params;
#endif
bool Init(int argc, char* argv[]);
void UnInit();

View File

@ -1245,6 +1245,8 @@ void Player::_CMExecCommand(f8::MsgHdr& hdr, const cs::CMExecCommand& msg)
SendDebugMsg(a8::Format("attr_id:%d abs_val:%f rate_val:%f", {attr_id, abs_val, rate_val}));
} else if (cmd == "bufflist") {
SendDebugMsg(DebugOutBuffList());
} else if (cmd == "set_inactive_time" && cmds.size() >= 2) {
App::Instance()->debug_params[1] = a8::XValue(cmds[1]);
} else if (cmd == "reset_skill" && cmds.size() >= 2) {
int skill_id = a8::XValue(cmds[1]);
Skill* skill = GetSkill(skill_id);

View File

@ -2422,7 +2422,8 @@ ObstacleData* Room::GetPermanentObstacleData(int obstacle_uniid)
long long Room::GetGasInactiveTime()
{
#ifdef DEBUG
return f8::IsOnlineEnv() ? 10 : 10;
return App::Instance()->debug_params.find(1) != App::Instance()->debug_params.end() ?
App::Instance()->debug_params[1] : 10;
#endif
if (room_mode_ == kZombieMode) {
#if DEBUG

View File

@ -584,5 +584,13 @@ void RoomObstacle::OnBattleStart(Room* room)
void RoomObstacle::Destory()
{
#if DEBUG
room->BroadcastDebugMsg(a8::Format("obstacle destory uniid:%d pos:%d,%d",
{
GetUniId(),
GetPos().x,
GetPos().y
}));
#endif
DetachFromMaster();
}