This commit is contained in:
aozhiwei 2019-07-17 14:22:43 +08:00
parent 5db5fcf1a0
commit 4d8bac715f

View File

@ -142,7 +142,7 @@ Player* Room::GetPlayerByUniId(int uniid)
Human* Room::GetHumanByUniId(int uniid) Human* Room::GetHumanByUniId(int uniid)
{ {
Entity* entity = GetEntityByUniId(uniid); Entity* entity = GetEntityByUniId(uniid);
return entity->entity_type == ET_Player ? (Human*)entity : nullptr; return entity && entity->entity_type == ET_Player ? (Human*)entity : nullptr;
} }
Entity* Room::GetEntityByUniId(int uniid) Entity* Room::GetEntityByUniId(int uniid)