mirror of
https://github.com/celisej567/mcpe.git
synced 2026-01-04 14:09:47 +03:00
Revert "* Improve the entity ID system, and add priority system. We should no longer have clashes."
This reverts commit 1b97875dd6.
This commit is contained in:
@@ -279,14 +279,6 @@ Material* Level::getMaterial(int x, int y, int z)
|
||||
|
||||
Entity* Level::getEntity(int id)
|
||||
{
|
||||
// always prioritize players!!
|
||||
for (auto it = m_entities.begin(); it != m_entities.end(); it++)
|
||||
{
|
||||
Entity* pEnt = *it;
|
||||
if (pEnt->isPlayer() && pEnt->m_EntityID == id)
|
||||
return pEnt;
|
||||
}
|
||||
|
||||
for (auto it = m_entities.begin(); it != m_entities.end(); it++)
|
||||
{
|
||||
Entity* pEnt = *it;
|
||||
@@ -1070,12 +1062,7 @@ bool Level::addEntity(Entity* pEnt)
|
||||
{
|
||||
Entity* pOldEnt = getEntity(pEnt->hashCode());
|
||||
if (pOldEnt)
|
||||
{
|
||||
if (pOldEnt->isUnimportant())
|
||||
removeEntity(pOldEnt);
|
||||
else
|
||||
LogMsg("Clash of entity IDs! (%d) This could go bad", pEnt->hashCode());
|
||||
}
|
||||
removeEntity(pOldEnt);
|
||||
|
||||
//@NOTE: useless Mth::floor() calls
|
||||
Mth::floor(pEnt->m_pos.x / 16);
|
||||
|
||||
Reference in New Issue
Block a user