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:
iProgramInCpp
2023-08-08 10:22:13 +03:00
parent 57c2b339ea
commit 1fdd94a43e
9 changed files with 6 additions and 78 deletions

View File

@@ -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);