修复机器人问题
This commit is contained in:
parent
bb24c44830
commit
46f9c01c9f
@ -58,13 +58,15 @@ static void SavePerfLog()
|
|||||||
App::Instance()->perf.max_run_delay_time,
|
App::Instance()->perf.max_run_delay_time,
|
||||||
RoomMgr::Instance()->RoomNum()
|
RoomMgr::Instance()->RoomNum()
|
||||||
});
|
});
|
||||||
a8::XPrintf("max_mainloop_rundelay:%d max_dispatchmsg_time:%d room_num:%d player_num:%d\n",
|
if (App::Instance()->flags.find(4) != App::Instance()->flags.end()) {
|
||||||
{
|
a8::XPrintf("max_mainloop_rundelay:%d max_dispatchmsg_time:%d room_num:%d player_num:%d\n",
|
||||||
App::Instance()->perf.max_run_delay_time,
|
{
|
||||||
App::Instance()->perf.max_dispatchmsg_time,
|
App::Instance()->perf.max_run_delay_time,
|
||||||
RoomMgr::Instance()->RoomNum(),
|
App::Instance()->perf.max_dispatchmsg_time,
|
||||||
PlayerMgr::Instance()->GetPlayerNum()
|
RoomMgr::Instance()->RoomNum(),
|
||||||
});
|
PlayerMgr::Instance()->GetPlayerNum()
|
||||||
|
});
|
||||||
|
}
|
||||||
App::Instance()->perf.max_run_delay_time = 0;
|
App::Instance()->perf.max_run_delay_time = 0;
|
||||||
App::Instance()->perf.max_dispatchmsg_time = 0;
|
App::Instance()->perf.max_dispatchmsg_time = 0;
|
||||||
App::Instance()->perf.max_timer_idle = 0;
|
App::Instance()->perf.max_timer_idle = 0;
|
||||||
|
@ -692,6 +692,11 @@ void Human::AddToPartObjects(Entity* entity)
|
|||||||
part_objects.insert(entity);
|
part_objects.insert(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Human::RemovePartObjects(Entity* entity)
|
||||||
|
{
|
||||||
|
part_objects.erase(entity);
|
||||||
|
}
|
||||||
|
|
||||||
void Human::RemoveObjects(Entity* entity)
|
void Human::RemoveObjects(Entity* entity)
|
||||||
{
|
{
|
||||||
del_objects.insert(entity->entity_uniid);
|
del_objects.insert(entity->entity_uniid);
|
||||||
|
@ -134,6 +134,7 @@ class Human : public Entity
|
|||||||
void DecHP(float dec_hp, int killer_id, const std::string& killer_name, int weapon_id);
|
void DecHP(float dec_hp, int killer_id, const std::string& killer_name, int weapon_id);
|
||||||
void AddToNewObjects(Entity* entity);
|
void AddToNewObjects(Entity* entity);
|
||||||
void AddToPartObjects(Entity* entity);
|
void AddToPartObjects(Entity* entity);
|
||||||
|
void RemovePartObjects(Entity* entity);
|
||||||
void RemoveObjects(Entity* entity);
|
void RemoveObjects(Entity* entity);
|
||||||
void AddOutObjects(Entity* entity);
|
void AddOutObjects(Entity* entity);
|
||||||
void RemoveOutObjects(Entity* entity);
|
void RemoveOutObjects(Entity* entity);
|
||||||
|
@ -1192,6 +1192,9 @@ void Room::RandRemoveAndroid()
|
|||||||
human_hash_.erase(hum->entity_uniid);
|
human_hash_.erase(hum->entity_uniid);
|
||||||
removed_robot_hash_[hum->entity_uniid] = hum;
|
removed_robot_hash_[hum->entity_uniid] = hum;
|
||||||
--alive_count_;
|
--alive_count_;
|
||||||
|
for (auto& pair : human_hash_) {
|
||||||
|
pair.second->RemovePartObjects(hum);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user