1
This commit is contained in:
parent
af84f142b1
commit
688c6c728c
@ -1195,6 +1195,11 @@ void Room::TraverseHumanList(std::function<bool (Human*)> func)
|
|||||||
void Room::TraverseAliveHumanList(std::function<bool (Human*)> func)
|
void Room::TraverseAliveHumanList(std::function<bool (Human*)> func)
|
||||||
{
|
{
|
||||||
for (auto& pair : alive_human_hash_) {
|
for (auto& pair : alive_human_hash_) {
|
||||||
|
#ifdef MYDEBUG
|
||||||
|
if (pair.second->IsOb()) {
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (pair.second) {
|
if (pair.second) {
|
||||||
if (!func(pair.second)) {
|
if (!func(pair.second)) {
|
||||||
break;
|
break;
|
||||||
@ -1217,6 +1222,11 @@ void Room::TraverseEntityList(std::function<bool (Entity*)> func)
|
|||||||
void Room::TraverseAlivePlayers(std::function<bool (Human*)> func)
|
void Room::TraverseAlivePlayers(std::function<bool (Human*)> func)
|
||||||
{
|
{
|
||||||
for (auto& pair : alive_player_hash_) {
|
for (auto& pair : alive_player_hash_) {
|
||||||
|
#ifdef MYDEBUG
|
||||||
|
if (pair.second->IsOb()) {
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (!func(pair.second)) {
|
if (!func(pair.second)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2504,6 +2514,11 @@ void Room::AddToHumanHash(Human* hum)
|
|||||||
|
|
||||||
void Room::AddToAliveHumanHash(Human* hum)
|
void Room::AddToAliveHumanHash(Human* hum)
|
||||||
{
|
{
|
||||||
|
#ifdef MYDEBUG
|
||||||
|
if (hum->IsOb()) {
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
alive_human_hash_[hum->GetUniId()] = hum;
|
alive_human_hash_[hum->GetUniId()] = hum;
|
||||||
if (hum->IsPlayer()) {
|
if (hum->IsPlayer()) {
|
||||||
alive_player_hash_[hum->GetUniId()] = hum;
|
alive_player_hash_[hum->GetUniId()] = hum;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user