From c728ac4ec5416f5c9ec614667e145d4814af3d2f Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 12 Apr 2021 19:10:42 +0800 Subject: [PATCH] 1 --- server/gameserver/incubator.cc | 8 ++++++++ server/gameserver/room.cc | 6 ++++++ server/gameserver/room.h | 1 + 3 files changed, 15 insertions(+) diff --git a/server/gameserver/incubator.cc b/server/gameserver/incubator.cc index 6e8ad4d..84ee284 100644 --- a/server/gameserver/incubator.cc +++ b/server/gameserver/incubator.cc @@ -14,7 +14,15 @@ void Incubator::UnInit() void Incubator::RecycleAndroid(Human* hum) { + #if 0 + room->TouchPlayerList + ( + a8::XParams(), + [] (Player* hum, a8::XParams& param) + { + }); + #endif } void Incubator::AddHoldHuman(Human* hum) diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index 456d1f2..125bdfe 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -2993,6 +2993,9 @@ void Room::AddToHumanHash(Human* hum) void Room::AddToAliveHumanHash(Human* hum) { alive_human_hash_[hum->GetEntityUniId()] = hum; + if (hum->IsPlayer()) { + alive_player_hash_[hum->GetEntityUniId()] = hum; + } } void Room::AddToMoveableHash(MoveableEntity* entity) @@ -3033,6 +3036,9 @@ void Room::RemoveFromHuamnHash(Human* hum) void Room::RemoveFromAliveHumanHash(Human* hum) { alive_human_hash_.erase(hum->GetEntityUniId()); + if (hum->IsPlayer()) { + alive_player_hash_.erase(hum->GetEntityUniId()); + } } void Room::RemoveFromLaterAddHash(RoomEntity* entity) diff --git a/server/gameserver/room.h b/server/gameserver/room.h index 26e99b0..61acea0 100644 --- a/server/gameserver/room.h +++ b/server/gameserver/room.h @@ -311,6 +311,7 @@ private: std::map later_add_hash_; std::map human_hash_; std::map alive_human_hash_; + std::map alive_player_hash_; std::map last_human_hash_; std::map born_point_hash_;