This commit is contained in:
aozhiwei 2019-08-16 14:21:55 +08:00
parent 3d1b61ce91
commit b6fc90b9bc

View File

@ -134,7 +134,7 @@ Player* Room::GetPlayerByAccountId(const std::string& accountid)
Player* Room::GetPlayerByUniId(int uniid)
{
Entity* entity = GetEntityByUniId(uniid);
return entity->entity_type == ET_Player && entity->entity_subtype == EST_Player ? (Player*)entity : nullptr;
return entity && entity->entity_type == ET_Player && entity->entity_subtype == EST_Player ? (Player*)entity : nullptr;
}
Entity* Room::GetEntityByUniId(int uniid)