Revert "Project modernization (#630)"
This code was not tested and breaks in Release builds, reverting to restore
functionality of the nightly. All in-game menus do not work and generating
a world crashes.
This reverts commit a9be52c41a.
This commit is contained in:
@@ -59,7 +59,7 @@ void EntityTracker::addEntity(shared_ptr<Entity> e)
|
||||
else if (e->instanceof(eTYPE_SQUID)) addEntity(e, 16 * 4, 1, true);
|
||||
else if (e->instanceof(eTYPE_WITHERBOSS)) addEntity(e, 16 * 5, 1, false);
|
||||
else if (e->instanceof(eTYPE_BAT)) addEntity(e, 16 * 5, 1, false);
|
||||
else if (dynamic_pointer_cast<Creature>(e)!=nullptr) addEntity(e, 16 * 5, 1, true);
|
||||
else if (dynamic_pointer_cast<Creature>(e)!=NULL) addEntity(e, 16 * 5, 1, true);
|
||||
else if (e->instanceof(eTYPE_ENDERDRAGON)) addEntity(e, 16 * 10, 1, true);
|
||||
else if (e->instanceof(eTYPE_PRIMEDTNT)) addEntity(e, 16 * 10, 10, true);
|
||||
else if (e->instanceof(eTYPE_FALLINGTILE)) addEntity(e, 16 * 10, 20, true);
|
||||
@@ -85,7 +85,7 @@ void EntityTracker::addEntity(shared_ptr<Entity> e, int range, int updateInterva
|
||||
{
|
||||
__debugbreak();
|
||||
}
|
||||
shared_ptr<TrackedEntity> te = std::make_shared<TrackedEntity>(e, range, updateInterval, trackDeltas);
|
||||
shared_ptr<TrackedEntity> te = shared_ptr<TrackedEntity>( new TrackedEntity(e, range, updateInterval, trackDeltas) );
|
||||
entities.insert(te);
|
||||
entityMap[e->entityId] = te;
|
||||
te->updatePlayers(this, &level->players);
|
||||
@@ -145,9 +145,9 @@ void EntityTracker::tick()
|
||||
shared_ptr<ServerPlayer> ep = server->getPlayers()->players[i];
|
||||
if( ep->dimension != level->dimension->id ) continue;
|
||||
|
||||
if( ep->connection == nullptr ) continue;
|
||||
if( ep->connection == NULL ) continue;
|
||||
INetworkPlayer *thisPlayer = ep->connection->getNetworkPlayer();
|
||||
if( thisPlayer == nullptr ) continue;
|
||||
if( thisPlayer == NULL ) continue;
|
||||
|
||||
bool addPlayer = false;
|
||||
for (unsigned int j = 0; j < movedPlayers.size(); j++)
|
||||
@@ -156,9 +156,9 @@ void EntityTracker::tick()
|
||||
|
||||
if( sp == ep ) break;
|
||||
|
||||
if(sp->connection == nullptr) continue;
|
||||
if(sp->connection == NULL) continue;
|
||||
INetworkPlayer *otherPlayer = sp->connection->getNetworkPlayer();
|
||||
if( otherPlayer != nullptr && thisPlayer->IsSameSystem(otherPlayer) )
|
||||
if( otherPlayer != NULL && thisPlayer->IsSameSystem(otherPlayer) )
|
||||
{
|
||||
addPlayer = true;
|
||||
break;
|
||||
@@ -170,7 +170,7 @@ void EntityTracker::tick()
|
||||
for (unsigned int i = 0; i < movedPlayers.size(); i++)
|
||||
{
|
||||
shared_ptr<ServerPlayer> player = movedPlayers[i];
|
||||
if(player->connection == nullptr) continue;
|
||||
if(player->connection == NULL) continue;
|
||||
for( auto& te : entities )
|
||||
{
|
||||
if ( te && te->e != player)
|
||||
|
||||
Reference in New Issue
Block a user