From 771bccf2d2cc31e6d333fda1aae27ad431243bf5 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 28 May 2020 20:40:11 +0800 Subject: [PATCH] 1 --- server/gameserver/room.cc | 11 +++++------ server/gameserver/room.h | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index 67851f6..f5dc408 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -2126,7 +2126,7 @@ void Room::ProcDieAndroid(int die_time, int die_num) die_num }); #endif - std::vector alive_humans; + std::vector alive_humans; alive_humans.reserve(human_hash_.size()); { if (frame_no % 8 < 5) { @@ -2174,11 +2174,11 @@ void Room::ProcDieAndroid(int die_time, int die_num) } int dead_num = 0; int try_count = 0; - std::vector alive_humans_copy = alive_humans; + std::vector alive_humans_copy = alive_humans; do { for (size_t i = 0; i < alive_humans.size(); ++i) { - Android* hum = alive_humans[i]; - Android* killer = nullptr; + Human* hum = alive_humans[i]; + Human* killer = nullptr; for (size_t ii = i + 1; ii < alive_humans_copy.size(); ++ii) { killer = alive_humans_copy[ii]; alive_humans.erase(alive_humans.begin() + ii); @@ -2402,14 +2402,13 @@ void Room::CheckPartObjects(Human* testa, Human* testb) } } -void Room::CheckAliveHuman(Human* hum, std::vector& alive_humans) +void Room::CheckAliveHuman(Human* hum, std::vector& alive_humans) { if (hum->IsAndroid() && !hum->real_dead && hum->team_uuid.empty() && a8::HasBitFlag(hum->status, HS_Disable) && !HasPlayerInRound(hum->GetPos(), VIEW_RANGE)) { - Android* hum = (Android*)hum; alive_humans.push_back(hum); } } diff --git a/server/gameserver/room.h b/server/gameserver/room.h index c12a3ae..28d220c 100644 --- a/server/gameserver/room.h +++ b/server/gameserver/room.h @@ -170,7 +170,7 @@ private: void ProcDisableHuman(); void OnHumanGridChg(Human* target); void ShuaGridRound(Human* target); - void CheckAliveHuman(Human* hum, std::vector& alive_humans); + void CheckAliveHuman(Human* hum, std::vector& alive_humans); private: int elapsed_time_ = 0;