refactor: expand AUTO_VAR macro

This commit is contained in:
Tropical 2026-03-29 23:59:05 -05:00
parent a330ecdcbb
commit e45151ae64
201 changed files with 1051 additions and 1055 deletions

View file

@ -131,7 +131,7 @@ void MultiPlayerLevel::tick() {
// 4J HEG - Copy the connections vector to prevent crash when moving to // 4J HEG - Copy the connections vector to prevent crash when moving to
// Nether // Nether
std::vector<ClientConnection*> connectionsTemp = connections; std::vector<ClientConnection*> connectionsTemp = connections;
for (AUTO_VAR(connection, connectionsTemp.begin()); for (auto connection = connectionsTemp.begin();
connection < connectionsTemp.end(); ++connection) { connection < connectionsTemp.end(); ++connection) {
(*connection)->tick(); (*connection)->tick();
} }
@ -391,8 +391,8 @@ void MultiPlayerLevel::tickTiles() {
PIXEndNamedEvent(); PIXEndNamedEvent();
PIXBeginNamedEvent(0, "Ticking client side tiles"); PIXBeginNamedEvent(0, "Ticking client side tiles");
AUTO_VAR(itEndCtp, chunksToPoll.end()); auto itEndCtp = chunksToPoll.end();
for (AUTO_VAR(it, chunksToPoll.begin()); it != itEndCtp; it++) { for (auto it = chunksToPoll.begin(); it != itEndCtp; it++) {
ChunkPos cp = *it; ChunkPos cp = *it;
int xo = cp.x * 16; int xo = cp.x * 16;
int zo = cp.z * 16; int zo = cp.z * 16;
@ -432,7 +432,7 @@ void MultiPlayerLevel::removeEntity(std::shared_ptr<Entity> e) {
// 4J Stu - Add this remove from the reEntries collection to stop us // 4J Stu - Add this remove from the reEntries collection to stop us
// continually removing and re-adding things, in particular the // continually removing and re-adding things, in particular the
// MultiPlayerLocalPlayer when they die // MultiPlayerLocalPlayer when they die
AUTO_VAR(it, reEntries.find(e)); auto it = reEntries.find(e);
if (it != reEntries.end()) { if (it != reEntries.end()) {
reEntries.erase(it); reEntries.erase(it);
} }
@ -443,7 +443,7 @@ void MultiPlayerLevel::removeEntity(std::shared_ptr<Entity> e) {
void MultiPlayerLevel::entityAdded(std::shared_ptr<Entity> e) { void MultiPlayerLevel::entityAdded(std::shared_ptr<Entity> e) {
Level::entityAdded(e); Level::entityAdded(e);
AUTO_VAR(it, reEntries.find(e)); auto it = reEntries.find(e);
if (it != reEntries.end()) { if (it != reEntries.end()) {
reEntries.erase(it); reEntries.erase(it);
} }
@ -451,7 +451,7 @@ void MultiPlayerLevel::entityAdded(std::shared_ptr<Entity> e) {
void MultiPlayerLevel::entityRemoved(std::shared_ptr<Entity> e) { void MultiPlayerLevel::entityRemoved(std::shared_ptr<Entity> e) {
Level::entityRemoved(e); Level::entityRemoved(e);
AUTO_VAR(it, forced.find(e)); auto it = forced.find(e);
if (it != forced.end()) { if (it != forced.end()) {
reEntries.insert(e); reEntries.insert(e);
} }
@ -472,14 +472,14 @@ void MultiPlayerLevel::putEntity(int id, std::shared_ptr<Entity> e) {
} }
std::shared_ptr<Entity> MultiPlayerLevel::getEntity(int id) { std::shared_ptr<Entity> MultiPlayerLevel::getEntity(int id) {
AUTO_VAR(it, entitiesById.find(id)); auto it = entitiesById.find(id);
if (it == entitiesById.end()) return nullptr; if (it == entitiesById.end()) return nullptr;
return it->second; return it->second;
} }
std::shared_ptr<Entity> MultiPlayerLevel::removeEntity(int id) { std::shared_ptr<Entity> MultiPlayerLevel::removeEntity(int id) {
std::shared_ptr<Entity> e; std::shared_ptr<Entity> e;
AUTO_VAR(it, entitiesById.find(id)); auto it = entitiesById.find(id);
if (it != entitiesById.end()) { if (it != entitiesById.end()) {
e = it->second; e = it->second;
entitiesById.erase(it); entitiesById.erase(it);
@ -495,10 +495,10 @@ std::shared_ptr<Entity> MultiPlayerLevel::removeEntity(int id) {
// remove entities slightly differently // remove entities slightly differently
void MultiPlayerLevel::removeEntities( void MultiPlayerLevel::removeEntities(
std::vector<std::shared_ptr<Entity> >* list) { std::vector<std::shared_ptr<Entity> >* list) {
for (AUTO_VAR(it, list->begin()); it < list->end(); ++it) { for (auto it = list->begin(); it < list->end(); ++it) {
std::shared_ptr<Entity> e = *it; std::shared_ptr<Entity> e = *it;
AUTO_VAR(reIt, reEntries.find(e)); auto reIt = reEntries.find(e);
if (reIt != reEntries.end()) { if (reIt != reEntries.end()) {
reEntries.erase(reIt); reEntries.erase(reIt);
} }
@ -613,12 +613,12 @@ bool MultiPlayerLevel::doSetTileAndData(int x, int y, int z, int tile,
void MultiPlayerLevel::disconnect(bool sendDisconnect /*= true*/) { void MultiPlayerLevel::disconnect(bool sendDisconnect /*= true*/) {
if (sendDisconnect) { if (sendDisconnect) {
for (AUTO_VAR(it, connections.begin()); it < connections.end(); ++it) { for (auto it = connections.begin(); it < connections.end(); ++it) {
(*it)->sendAndDisconnect(std::shared_ptr<DisconnectPacket>( (*it)->sendAndDisconnect(std::shared_ptr<DisconnectPacket>(
new DisconnectPacket(DisconnectPacket::eDisconnect_Quitting))); new DisconnectPacket(DisconnectPacket::eDisconnect_Quitting)));
} }
} else { } else {
for (AUTO_VAR(it, connections.begin()); it < connections.end(); ++it) { for (auto it = connections.begin(); it < connections.end(); ++it) {
(*it)->close(); (*it)->close();
} }
} }
@ -704,7 +704,7 @@ void MultiPlayerLevel::animateTickDoWork() {
MemSect(0); MemSect(0);
for (int i = 0; i < ticksPerChunk; i++) { for (int i = 0; i < ticksPerChunk; i++) {
for (AUTO_VAR(it, chunksToAnimate.begin()); it != chunksToAnimate.end(); for (auto it = chunksToAnimate.begin(); it != chunksToAnimate.end();
it++) { it++) {
int packed = *it; int packed = *it;
// 4jcraft changed the extraction logic to be safe // 4jcraft changed the extraction logic to be safe
@ -809,9 +809,9 @@ void MultiPlayerLevel::removeAllPendingEntityRemovals() {
// entities.removeAll(entitiesToRemove); // entities.removeAll(entitiesToRemove);
EnterCriticalSection(&m_entitiesCS); EnterCriticalSection(&m_entitiesCS);
for (AUTO_VAR(it, entities.begin()); it != entities.end();) { for (auto it = entities.begin(); it != entities.end();) {
bool found = false; bool found = false;
for (AUTO_VAR(it2, entitiesToRemove.begin()); for (auto it2 = entitiesToRemove.begin();
it2 != entitiesToRemove.end(); it2++) { it2 != entitiesToRemove.end(); it2++) {
if ((*it) == (*it2)) { if ((*it) == (*it2)) {
found = true; found = true;
@ -826,8 +826,8 @@ void MultiPlayerLevel::removeAllPendingEntityRemovals() {
} }
LeaveCriticalSection(&m_entitiesCS); LeaveCriticalSection(&m_entitiesCS);
AUTO_VAR(endIt, entitiesToRemove.end()); auto endIt = entitiesToRemove.end();
for (AUTO_VAR(it, entitiesToRemove.begin()); it != endIt; it++) { for (auto it = entitiesToRemove.begin(); it != endIt; it++) {
std::shared_ptr<Entity> e = *it; std::shared_ptr<Entity> e = *it;
int xc = e->xChunk; int xc = e->xChunk;
int zc = e->zChunk; int zc = e->zChunk;
@ -839,7 +839,7 @@ void MultiPlayerLevel::removeAllPendingEntityRemovals() {
// 4J Stu - Is there a reason do this in a separate loop? Thats what the // 4J Stu - Is there a reason do this in a separate loop? Thats what the
// Java does... // Java does...
endIt = entitiesToRemove.end(); endIt = entitiesToRemove.end();
for (AUTO_VAR(it, entitiesToRemove.begin()); it != endIt; it++) { for (auto it = entitiesToRemove.begin(); it != endIt; it++) {
entityRemoved(*it); entityRemoved(*it);
} }
entitiesToRemove.clear(); entitiesToRemove.clear();
@ -884,7 +884,7 @@ void MultiPlayerLevel::removeClientConnection(ClientConnection* c,
new DisconnectPacket(DisconnectPacket::eDisconnect_Quitting))); new DisconnectPacket(DisconnectPacket::eDisconnect_Quitting)));
} }
AUTO_VAR(it, find(connections.begin(), connections.end(), c)); auto it = find(connections.begin(), connections.end(), c);
if (it != connections.end()) { if (it != connections.end()) {
connections.erase(it); connections.erase(it);
} }
@ -892,7 +892,7 @@ void MultiPlayerLevel::removeClientConnection(ClientConnection* c,
void MultiPlayerLevel::tickAllConnections() { void MultiPlayerLevel::tickAllConnections() {
PIXBeginNamedEvent(0, "Connection ticking"); PIXBeginNamedEvent(0, "Connection ticking");
for (AUTO_VAR(it, connections.begin()); it < connections.end(); ++it) { for (auto it = connections.begin(); it < connections.end(); ++it) {
(*it)->tick(); (*it)->tick();
} }
PIXEndNamedEvent(); PIXEndNamedEvent();

View file

@ -189,7 +189,7 @@ ServerLevel::~ServerLevel() {
delete mobSpawner; delete mobSpawner;
EnterCriticalSection(&m_csQueueSendTileUpdates); EnterCriticalSection(&m_csQueueSendTileUpdates);
for (AUTO_VAR(it, m_queuedSendTileUpdates.begin()); for (auto it = m_queuedSendTileUpdates.begin();
it != m_queuedSendTileUpdates.end(); ++it) { it != m_queuedSendTileUpdates.end(); ++it) {
Pos* p = *it; Pos* p = *it;
delete p; delete p;
@ -270,8 +270,8 @@ void ServerLevel::tick() {
if (!SharedConstants::TEXTURE_LIGHTING) // 4J - change brought forward if (!SharedConstants::TEXTURE_LIGHTING) // 4J - change brought forward
// from 1.8.2 // from 1.8.2
{ {
AUTO_VAR(itEnd, listeners.end()); auto itEnd = listeners.end();
for (AUTO_VAR(it, listeners.begin()); it != itEnd; it++) { for (auto it = listeners.begin(); it != itEnd; it++) {
(*it)->skyColorChanged(); (*it)->skyColorChanged();
} }
} }
@ -361,8 +361,8 @@ void ServerLevel::updateSleepingPlayerList() {
allPlayersSleeping = !players.empty(); allPlayersSleeping = !players.empty();
m_bAtLeastOnePlayerSleeping = false; m_bAtLeastOnePlayerSleeping = false;
AUTO_VAR(itEnd, players.end()); auto itEnd = players.end();
for (AUTO_VAR(it, players.begin()); it != itEnd; it++) { for (auto it = players.begin(); it != itEnd; it++) {
if (!(*it)->isSleeping()) { if (!(*it)->isSleeping()) {
allPlayersSleeping = false; allPlayersSleeping = false;
// break; // break;
@ -377,7 +377,7 @@ void ServerLevel::awakenAllPlayers() {
allPlayersSleeping = false; allPlayersSleeping = false;
m_bAtLeastOnePlayerSleeping = false; m_bAtLeastOnePlayerSleeping = false;
AUTO_VAR(itEnd, players.end()); auto itEnd = players.end();
for (std::vector<std::shared_ptr<Player> >::iterator it = players.begin(); for (std::vector<std::shared_ptr<Player> >::iterator it = players.begin();
it != itEnd; it++) { it != itEnd; it++) {
if ((*it)->isSleeping()) { if ((*it)->isSleeping()) {
@ -398,7 +398,7 @@ void ServerLevel::stopWeather() {
bool ServerLevel::allPlayersAreSleeping() { bool ServerLevel::allPlayersAreSleeping() {
if (allPlayersSleeping && !isClientSide) { if (allPlayersSleeping && !isClientSide) {
// all players are sleeping, but have they slept long enough? // all players are sleeping, but have they slept long enough?
AUTO_VAR(itEnd, players.end()); auto itEnd = players.end();
for (std::vector<std::shared_ptr<Player> >::iterator it = for (std::vector<std::shared_ptr<Player> >::iterator it =
players.begin(); players.begin();
it != itEnd; it++) { it != itEnd; it++) {
@ -483,8 +483,8 @@ void ServerLevel::tickTiles() {
if (app.GetGameSettingsDebugMask() & (1L << eDebugSetting_RegularLightning)) if (app.GetGameSettingsDebugMask() & (1L << eDebugSetting_RegularLightning))
prob = 100; prob = 100;
AUTO_VAR(itEndCtp, chunksToPoll.end()); auto itEndCtp = chunksToPoll.end();
for (AUTO_VAR(it, chunksToPoll.begin()); it != itEndCtp; it++) { for (auto it = chunksToPoll.begin(); it != itEndCtp; it++) {
ChunkPos cp = *it; ChunkPos cp = *it;
int xo = cp.x * 16; int xo = cp.x * 16;
int zo = cp.z * 16; int zo = cp.z * 16;
@ -653,7 +653,7 @@ bool ServerLevel::tickPendingTicks(bool force) {
} }
if (count > MAX_TICK_TILES_PER_TICK) count = MAX_TICK_TILES_PER_TICK; if (count > MAX_TICK_TILES_PER_TICK) count = MAX_TICK_TILES_PER_TICK;
AUTO_VAR(itTickList, tickNextTickList.begin()); auto itTickList = tickNextTickList.begin();
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
TickNextTickData td = *(itTickList); TickNextTickData td = *(itTickList);
if (!force && td.m_delay > levelData->getGameTime()) { if (!force && td.m_delay > levelData->getGameTime()) {
@ -665,7 +665,7 @@ bool ServerLevel::tickPendingTicks(bool force) {
toBeTicked.push_back(td); toBeTicked.push_back(td);
} }
for (AUTO_VAR(it, toBeTicked.begin()); it != toBeTicked.end();) { for (auto it = toBeTicked.begin(); it != toBeTicked.end();) {
TickNextTickData td = *it; TickNextTickData td = *it;
it = toBeTicked.erase(it); it = toBeTicked.erase(it);
@ -707,7 +707,7 @@ std::vector<TickNextTickData>* ServerLevel::fetchTicksInChunk(LevelChunk* chunk,
for (int i = 0; i < 2; i++) { for (int i = 0; i < 2; i++) {
if (i == 0) { if (i == 0) {
for (AUTO_VAR(it, tickNextTickList.begin()); for (auto it = tickNextTickList.begin();
it != tickNextTickList.end();) { it != tickNextTickList.end();) {
TickNextTickData td = *it; TickNextTickData td = *it;
@ -729,7 +729,7 @@ std::vector<TickNextTickData>* ServerLevel::fetchTicksInChunk(LevelChunk* chunk,
if (!toBeTicked.empty()) { if (!toBeTicked.empty()) {
app.DebugPrintf("To be ticked size: %d\n", toBeTicked.size()); app.DebugPrintf("To be ticked size: %d\n", toBeTicked.size());
} }
for (AUTO_VAR(it, toBeTicked.begin()); it != toBeTicked.end();) { for (auto it = toBeTicked.begin(); it != toBeTicked.end();) {
TickNextTickData td = *it; TickNextTickData td = *it;
if (td.x >= xMin && td.x < xMax && td.z >= zMin && if (td.x >= xMin && td.x < xMax && td.z >= zMin &&
@ -954,7 +954,7 @@ void ServerLevel::save(bool force, ProgressListener* progressListener,
// clean cache // clean cache
std::vector<LevelChunk*>* loadedChunkList = std::vector<LevelChunk*>* loadedChunkList =
cache->getLoadedChunkList(); cache->getLoadedChunkList();
for (AUTO_VAR(it, loadedChunkList->begin()); for (auto it = loadedChunkList->begin();
it != loadedChunkList->end(); ++it) { it != loadedChunkList->end(); ++it) {
LevelChunk* lc = *it; LevelChunk* lc = *it;
if (!chunkMap->hasChunk(lc->x, lc->z)) { if (!chunkMap->hasChunk(lc->x, lc->z)) {
@ -1010,7 +1010,7 @@ void ServerLevel::entityAdded(std::shared_ptr<Entity> e) {
std::vector<std::shared_ptr<Entity> >* es = e->getSubEntities(); std::vector<std::shared_ptr<Entity> >* es = e->getSubEntities();
if (es != NULL) { if (es != NULL) {
// for (int i = 0; i < es.length; i++) // for (int i = 0; i < es.length; i++)
for (AUTO_VAR(it, es->begin()); it != es->end(); ++it) { for (auto it = es->begin(); it != es->end(); ++it) {
entitiesById.insert( entitiesById.insert(
intEntityMap::value_type((*it)->entityId, (*it))); intEntityMap::value_type((*it)->entityId, (*it)));
} }
@ -1024,7 +1024,7 @@ void ServerLevel::entityRemoved(std::shared_ptr<Entity> e) {
std::vector<std::shared_ptr<Entity> >* es = e->getSubEntities(); std::vector<std::shared_ptr<Entity> >* es = e->getSubEntities();
if (es != NULL) { if (es != NULL) {
// for (int i = 0; i < es.length; i++) // for (int i = 0; i < es.length; i++)
for (AUTO_VAR(it, es->begin()); it != es->end(); ++it) { for (auto it = es->begin(); it != es->end(); ++it) {
entitiesById.erase((*it)->entityId); entitiesById.erase((*it)->entityId);
} }
} }
@ -1070,7 +1070,7 @@ std::shared_ptr<Explosion> ServerLevel::explode(std::shared_ptr<Entity> source,
} }
std::vector<std::shared_ptr<ServerPlayer> > sentTo; std::vector<std::shared_ptr<ServerPlayer> > sentTo;
for (AUTO_VAR(it, players.begin()); it != players.end(); ++it) { for (auto it = players.begin(); it != players.end(); ++it) {
std::shared_ptr<ServerPlayer> player = std::shared_ptr<ServerPlayer> player =
std::dynamic_pointer_cast<ServerPlayer>(*it); std::dynamic_pointer_cast<ServerPlayer>(*it);
if (player->dimension != dimension->id) continue; if (player->dimension != dimension->id) continue;
@ -1115,7 +1115,7 @@ void ServerLevel::tileEvent(int x, int y, int z, int tile, int b0, int b1) {
// TileEventPacket(x, y, z, b0, b1)); // TileEventPacket(x, y, z, b0, b1));
TileEventData newEvent(x, y, z, tile, b0, b1); TileEventData newEvent(x, y, z, tile, b0, b1);
// for (TileEventData te : tileEvents[activeTileEventsList]) // for (TileEventData te : tileEvents[activeTileEventsList])
for (AUTO_VAR(it, tileEvents[activeTileEventsList].begin()); for (auto it = tileEvents[activeTileEventsList].begin();
it != tileEvents[activeTileEventsList].end(); ++it) { it != tileEvents[activeTileEventsList].end(); ++it) {
if ((*it).equals(newEvent)) { if ((*it).equals(newEvent)) {
return; return;
@ -1132,7 +1132,7 @@ void ServerLevel::runTileEvents() {
activeTileEventsList ^= 1; activeTileEventsList ^= 1;
// for (TileEventData te : tileEvents[runList]) // for (TileEventData te : tileEvents[runList])
for (AUTO_VAR(it, tileEvents[runList].begin()); for (auto it = tileEvents[runList].begin();
it != tileEvents[runList].end(); ++it) { it != tileEvents[runList].end(); ++it) {
if (doTileEvent(&(*it))) { if (doTileEvent(&(*it))) {
TileEventData te = *it; TileEventData te = *it;
@ -1185,7 +1185,7 @@ void ServerLevel::setTimeAndAdjustTileTicks(int64_t newTime) {
// in the set. Instead move to a vector, do the adjustment, put back in the // in the set. Instead move to a vector, do the adjustment, put back in the
// set. // set.
std::vector<TickNextTickData> temp; std::vector<TickNextTickData> temp;
for (AUTO_VAR(it, tickNextTickList.begin()); it != tickNextTickList.end(); for (auto it = tickNextTickList.begin(); it != tickNextTickList.end();
++it) { ++it) {
temp.push_back(*it); temp.push_back(*it);
temp.back().m_delay += delta; temp.back().m_delay += delta;
@ -1215,7 +1215,7 @@ void ServerLevel::sendParticles(const std::wstring& name, double x, double y,
name, (float)x, (float)y, (float)z, (float)xDist, (float)yDist, name, (float)x, (float)y, (float)z, (float)xDist, (float)yDist,
(float)zDist, (float)speed, count)); (float)zDist, (float)speed, count));
for (AUTO_VAR(it, players.begin()); it != players.end(); ++it) { for (auto it = players.begin(); it != players.end(); ++it) {
std::shared_ptr<ServerPlayer> player = std::shared_ptr<ServerPlayer> player =
std::dynamic_pointer_cast<ServerPlayer>(*it); std::dynamic_pointer_cast<ServerPlayer>(*it);
player->connection->send(packet); player->connection->send(packet);
@ -1232,7 +1232,7 @@ void ServerLevel::queueSendTileUpdate(int x, int y, int z) {
void ServerLevel::runQueuedSendTileUpdates() { void ServerLevel::runQueuedSendTileUpdates() {
EnterCriticalSection(&m_csQueueSendTileUpdates); EnterCriticalSection(&m_csQueueSendTileUpdates);
for (AUTO_VAR(it, m_queuedSendTileUpdates.begin()); for (auto it = m_queuedSendTileUpdates.begin();
it != m_queuedSendTileUpdates.end(); ++it) { it != m_queuedSendTileUpdates.end(); ++it) {
Pos* p = *it; Pos* p = *it;
sendTileUpdated(p->x, p->y, p->z); sendTileUpdated(p->x, p->y, p->z);
@ -1372,7 +1372,7 @@ void ServerLevel::entityRemovedExtra(std::shared_ptr<Entity> e) {
EnterCriticalSection(&m_limiterCS); EnterCriticalSection(&m_limiterCS);
// printf("entity removed: item entity count // printf("entity removed: item entity count
//%d\n",m_itemEntities.size()); //%d\n",m_itemEntities.size());
AUTO_VAR(it, find(m_itemEntities.begin(), m_itemEntities.end(), e)); auto it = find(m_itemEntities.begin(), m_itemEntities.end(), e);
if (it != m_itemEntities.end()) { if (it != m_itemEntities.end()) {
// printf("Item to remove found\n"); // printf("Item to remove found\n");
m_itemEntities.erase(it); m_itemEntities.erase(it);
@ -1384,8 +1384,8 @@ void ServerLevel::entityRemovedExtra(std::shared_ptr<Entity> e) {
EnterCriticalSection(&m_limiterCS); EnterCriticalSection(&m_limiterCS);
// printf("entity removed: item entity count // printf("entity removed: item entity count
//%d\n",m_itemEntities.size()); //%d\n",m_itemEntities.size());
AUTO_VAR(it, auto it =
find(m_hangingEntities.begin(), m_hangingEntities.end(), e)); find(m_hangingEntities.begin(), m_hangingEntities.end(), e);
if (it != m_hangingEntities.end()) { if (it != m_hangingEntities.end()) {
// printf("Item to remove found\n"); // printf("Item to remove found\n");
m_hangingEntities.erase(it); m_hangingEntities.erase(it);
@ -1397,7 +1397,7 @@ void ServerLevel::entityRemovedExtra(std::shared_ptr<Entity> e) {
EnterCriticalSection(&m_limiterCS); EnterCriticalSection(&m_limiterCS);
// printf("entity removed: arrow entity count // printf("entity removed: arrow entity count
//%d\n",m_arrowEntities.size()); //%d\n",m_arrowEntities.size());
AUTO_VAR(it, find(m_arrowEntities.begin(), m_arrowEntities.end(), e)); auto it = find(m_arrowEntities.begin(), m_arrowEntities.end(), e);
if (it != m_arrowEntities.end()) { if (it != m_arrowEntities.end()) {
// printf("Item to remove found\n"); // printf("Item to remove found\n");
m_arrowEntities.erase(it); m_arrowEntities.erase(it);
@ -1409,8 +1409,8 @@ void ServerLevel::entityRemovedExtra(std::shared_ptr<Entity> e) {
EnterCriticalSection(&m_limiterCS); EnterCriticalSection(&m_limiterCS);
// printf("entity removed: experience orb entity count // printf("entity removed: experience orb entity count
//%d\n",m_arrowEntities.size()); //%d\n",m_arrowEntities.size());
AUTO_VAR(it, find(m_experienceOrbEntities.begin(), auto it = find(m_experienceOrbEntities.begin(),
m_experienceOrbEntities.end(), e)); m_experienceOrbEntities.end(), e);
if (it != m_experienceOrbEntities.end()) { if (it != m_experienceOrbEntities.end()) {
// printf("Item to remove found\n"); // printf("Item to remove found\n");
m_experienceOrbEntities.erase(it); m_experienceOrbEntities.erase(it);

View file

@ -120,7 +120,7 @@ void ServerLevelListener::globalLevelEvent(int type, int sourceX, int sourceY,
void ServerLevelListener::destroyTileProgress(int id, int x, int y, int z, void ServerLevelListener::destroyTileProgress(int id, int x, int y, int z,
int progress) { int progress) {
// for (ServerPlayer p : server->getPlayers()->players) // for (ServerPlayer p : server->getPlayers()->players)
for (AUTO_VAR(it, server->getPlayers()->players.begin()); for (auto it = server->getPlayers()->players.begin();
it != server->getPlayers()->players.end(); ++it) { it != server->getPlayers()->players.end(); ++it) {
std::shared_ptr<ServerPlayer> p = *it; std::shared_ptr<ServerPlayer> p = *it;
if (p == NULL || p->level != level || p->entityId == id) continue; if (p == NULL || p->level != level || p->entityId == id) continue;

View file

@ -4484,8 +4484,8 @@ void Minecraft::tickAllConnections() {
bool Minecraft::addPendingClientTextureRequest( bool Minecraft::addPendingClientTextureRequest(
const std::wstring& textureName) { const std::wstring& textureName) {
AUTO_VAR(it, find(m_pendingTextureRequests.begin(), auto it = find(m_pendingTextureRequests.begin(),
m_pendingTextureRequests.end(), textureName)); m_pendingTextureRequests.end(), textureName);
if (it == m_pendingTextureRequests.end()) { if (it == m_pendingTextureRequests.end()) {
m_pendingTextureRequests.push_back(textureName); m_pendingTextureRequests.push_back(textureName);
return true; return true;
@ -4494,8 +4494,8 @@ bool Minecraft::addPendingClientTextureRequest(
} }
void Minecraft::handleClientTextureReceived(const std::wstring& textureName) { void Minecraft::handleClientTextureReceived(const std::wstring& textureName) {
AUTO_VAR(it, find(m_pendingTextureRequests.begin(), auto it = find(m_pendingTextureRequests.begin(),
m_pendingTextureRequests.end(), textureName)); m_pendingTextureRequests.end(), textureName);
if (it != m_pendingTextureRequests.end()) { if (it != m_pendingTextureRequests.end()) {
m_pendingTextureRequests.erase(it); m_pendingTextureRequests.erase(it);
} }

View file

@ -1396,7 +1396,7 @@ void MinecraftServer::broadcastStopSavingPacket() {
void MinecraftServer::tick() { void MinecraftServer::tick() {
std::vector<std::wstring> toRemove; std::vector<std::wstring> toRemove;
for (AUTO_VAR(it, ironTimers.begin()); it != ironTimers.end(); it++) { for (auto it = ironTimers.begin(); it != ironTimers.end(); it++) {
int t = it->second; int t = it->second;
if (t > 0) { if (t > 0) {
ironTimers[it->first] = t - 1; ironTimers[it->first] = t - 1;
@ -1512,7 +1512,7 @@ void MinecraftServer::handleConsoleInput(const std::wstring& msg,
void MinecraftServer::handleConsoleInputs() { void MinecraftServer::handleConsoleInputs() {
while (consoleInput.size() > 0) { while (consoleInput.size() > 0) {
AUTO_VAR(it, consoleInput.begin()); auto it = consoleInput.begin();
ConsoleInput* input = *it; ConsoleInput* input = *it;
consoleInput.erase(it); consoleInput.erase(it);
// commands->handleCommand(input); // 4J - removed // commands->handleCommand(input); // 4J - removed
@ -1612,8 +1612,8 @@ void MinecraftServer::chunkPacketManagement_PreTick() {
do { do {
int longestTime = 0; int longestTime = 0;
AUTO_VAR(playerConnectionBest, playersOrig.begin()); auto playerConnectionBest = playersOrig.begin();
for (AUTO_VAR(it, playersOrig.begin()); it != playersOrig.end(); for (auto it = playersOrig.begin(); it != playersOrig.end();
it++) { it++) {
int thisTime = 0; int thisTime = 0;
INetworkPlayer* np = (*it)->getNetworkPlayer(); INetworkPlayer* np = (*it)->getNetworkPlayer();

View file

@ -605,7 +605,7 @@ void ClientConnection::handleAddEntity(
if (subEntities != NULL) { if (subEntities != NULL) {
int offs = packet->id - e->entityId; int offs = packet->id - e->entityId;
// for (int i = 0; i < subEntities.length; i++) // for (int i = 0; i < subEntities.length; i++)
for (AUTO_VAR(it, subEntities->begin()); it != subEntities->end(); for (auto it = subEntities->begin(); it != subEntities->end();
++it) { ++it) {
(*it)->entityId += offs; (*it)->entityId += offs;
// subEntities[i].entityId += offs; // subEntities[i].entityId += offs;
@ -2003,7 +2003,7 @@ void ClientConnection::handleAddMob(std::shared_ptr<AddMobPacket> packet) {
if (subEntities != NULL) { if (subEntities != NULL) {
int offs = packet->id - mob->entityId; int offs = packet->id - mob->entityId;
// for (int i = 0; i < subEntities.length; i++) // for (int i = 0; i < subEntities.length; i++)
for (AUTO_VAR(it, subEntities->begin()); it != subEntities->end(); for (auto it = subEntities->begin(); it != subEntities->end();
++it) { ++it) {
// subEntities[i].entityId += offs; // subEntities[i].entityId += offs;
(*it)->entityId += offs; (*it)->entityId += offs;
@ -3444,7 +3444,7 @@ void ClientConnection::handleUpdateAttributes(
(std::dynamic_pointer_cast<LivingEntity>(entity))->getAttributes(); (std::dynamic_pointer_cast<LivingEntity>(entity))->getAttributes();
std::unordered_set<UpdateAttributesPacket::AttributeSnapshot*> std::unordered_set<UpdateAttributesPacket::AttributeSnapshot*>
attributeSnapshots = packet->getValues(); attributeSnapshots = packet->getValues();
for (AUTO_VAR(it, attributeSnapshots.begin()); for (auto it = attributeSnapshots.begin();
it != attributeSnapshots.end(); ++it) { it != attributeSnapshots.end(); ++it) {
UpdateAttributesPacket::AttributeSnapshot* attribute = *it; UpdateAttributesPacket::AttributeSnapshot* attribute = *it;
AttributeInstance* instance = AttributeInstance* instance =
@ -3465,7 +3465,7 @@ void ClientConnection::handleUpdateAttributes(
std::unordered_set<AttributeModifier*>* modifiers = std::unordered_set<AttributeModifier*>* modifiers =
attribute->getModifiers(); attribute->getModifiers();
for (AUTO_VAR(it2, modifiers->begin()); it2 != modifiers->end(); for (auto it2 = modifiers->begin(); it2 != modifiers->end();
++it2) { ++it2) {
AttributeModifier* modifier = *it2; AttributeModifier* modifier = *it2;
instance->addModifier( instance->addModifier(

View file

@ -98,8 +98,8 @@ MultiPlayerChunkCache::~MultiPlayerChunkCache() {
delete cache; delete cache;
delete hasData; delete hasData;
AUTO_VAR(itEnd, loadedChunkList.end()); auto itEnd = loadedChunkList.end();
for (AUTO_VAR(it, loadedChunkList.begin()); it != itEnd; it++) delete *it; for (auto it = loadedChunkList.begin(); it != itEnd; it++) delete *it;
DeleteCriticalSection(&m_csLoadCreate); DeleteCriticalSection(&m_csLoadCreate);
} }

View file

@ -93,7 +93,7 @@ void PendingConnection::sendPreLoginResponse() {
StorageManager.GetSaveUniqueFilename(szUniqueMapName); StorageManager.GetSaveUniqueFilename(szUniqueMapName);
PlayerList* playerList = MinecraftServer::getInstance()->getPlayers(); PlayerList* playerList = MinecraftServer::getInstance()->getPlayers();
for (AUTO_VAR(it, playerList->players.begin()); for (auto it = playerList->players.begin();
it != playerList->players.end(); ++it) { it != playerList->players.end(); ++it) {
std::shared_ptr<ServerPlayer> player = *it; std::shared_ptr<ServerPlayer> player = *it;
// If the offline Xuid is invalid but the online one is not then that's // If the offline Xuid is invalid but the online one is not then that's

View file

@ -40,7 +40,7 @@ PlayerChunkMap::PlayerChunk::~PlayerChunk() { delete changedTiles.data; }
// output flag array and adds to it for this ServerPlayer. // output flag array and adds to it for this ServerPlayer.
void PlayerChunkMap::flagEntitiesToBeRemoved(unsigned int* flags, void PlayerChunkMap::flagEntitiesToBeRemoved(unsigned int* flags,
bool* flagToBeRemoved) { bool* flagToBeRemoved) {
for (AUTO_VAR(it, players.begin()); it != players.end(); it++) { for (auto it = players.begin(); it != players.end(); it++) {
std::shared_ptr<ServerPlayer> serverPlayer = *it; std::shared_ptr<ServerPlayer> serverPlayer = *it;
serverPlayer->flagEntitiesToBeRemoved(flags, flagToBeRemoved); serverPlayer->flagEntitiesToBeRemoved(flags, flagToBeRemoved);
} }
@ -89,7 +89,7 @@ void PlayerChunkMap::PlayerChunk::remove(std::shared_ptr<ServerPlayer> player) {
// app.DebugPrintf("--- PlayerChunkMap::PlayerChunk::remove // app.DebugPrintf("--- PlayerChunkMap::PlayerChunk::remove
// x=%d\tz=%d\n",x,z); // x=%d\tz=%d\n",x,z);
AUTO_VAR(it, find(players.begin(), players.end(), player)); auto it = find(players.begin(), players.end(), player);
if (it == players.end()) { if (it == players.end()) {
app.DebugPrintf( app.DebugPrintf(
"--- INFO - Removing player from chunk x=%d\t z=%d, but they are " "--- INFO - Removing player from chunk x=%d\t z=%d, but they are "
@ -104,20 +104,20 @@ void PlayerChunkMap::PlayerChunk::remove(std::shared_ptr<ServerPlayer> player) {
{ {
LevelChunk* chunk = parent->level->getChunk(pos.x, pos.z); LevelChunk* chunk = parent->level->getChunk(pos.x, pos.z);
updateInhabitedTime(chunk); updateInhabitedTime(chunk);
AUTO_VAR(it, find(parent->knownChunks.begin(), auto it = find(parent->knownChunks.begin(),
parent->knownChunks.end(), this)); parent->knownChunks.end(), this);
if (it != parent->knownChunks.end()) parent->knownChunks.erase(it); if (it != parent->knownChunks.end()) parent->knownChunks.erase(it);
} }
int64_t id = (pos.x + 0x7fffffffLL) | ((pos.z + 0x7fffffffLL) << 32); int64_t id = (pos.x + 0x7fffffffLL) | ((pos.z + 0x7fffffffLL) << 32);
AUTO_VAR(it, parent->chunks.find(id)); auto it = parent->chunks.find(id);
if (it != parent->chunks.end()) { if (it != parent->chunks.end()) {
toDelete = it->second; // Don't delete until the end of the toDelete = it->second; // Don't delete until the end of the
// function, as this might be this instance // function, as this might be this instance
parent->chunks.erase(it); parent->chunks.erase(it);
} }
if (changes > 0) { if (changes > 0) {
AUTO_VAR(it, find(parent->changedChunks.begin(), auto it = find(parent->changedChunks.begin(),
parent->changedChunks.end(), this)); parent->changedChunks.end(), this);
parent->changedChunks.erase(it); parent->changedChunks.erase(it);
} }
parent->getLevel()->cache->drop(pos.x, pos.z); parent->getLevel()->cache->drop(pos.x, pos.z);
@ -135,7 +135,7 @@ void PlayerChunkMap::PlayerChunk::remove(std::shared_ptr<ServerPlayer> player) {
bool noOtherPlayersFound = true; bool noOtherPlayersFound = true;
if (thisNetPlayer != NULL) { if (thisNetPlayer != NULL) {
for (AUTO_VAR(it, players.begin()); it < players.end(); ++it) { for (auto it = players.begin(); it < players.end(); ++it) {
std::shared_ptr<ServerPlayer> currPlayer = *it; std::shared_ptr<ServerPlayer> currPlayer = *it;
INetworkPlayer* currNetPlayer = INetworkPlayer* currNetPlayer =
currPlayer->connection->getNetworkPlayer(); currPlayer->connection->getNetworkPlayer();
@ -405,7 +405,7 @@ PlayerChunkMap::PlayerChunkMap(ServerLevel* level, int dimension, int radius) {
} }
PlayerChunkMap::~PlayerChunkMap() { PlayerChunkMap::~PlayerChunkMap() {
for (AUTO_VAR(it, chunks.begin()); it != chunks.end(); it++) { for (auto it = chunks.begin(); it != chunks.end(); it++) {
delete it->second; delete it->second;
} }
} }
@ -471,7 +471,7 @@ bool PlayerChunkMap::hasChunk(int x, int z) {
PlayerChunkMap::PlayerChunk* PlayerChunkMap::getChunk(int x, int z, PlayerChunkMap::PlayerChunk* PlayerChunkMap::getChunk(int x, int z,
bool create) { bool create) {
int64_t id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32); int64_t id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32);
AUTO_VAR(it, chunks.find(id)); auto it = chunks.find(id);
PlayerChunk* chunk = NULL; PlayerChunk* chunk = NULL;
if (it != chunks.end()) { if (it != chunks.end()) {
@ -490,7 +490,7 @@ PlayerChunkMap::PlayerChunk* PlayerChunkMap::getChunk(int x, int z,
void PlayerChunkMap::getChunkAndAddPlayer( void PlayerChunkMap::getChunkAndAddPlayer(
int x, int z, std::shared_ptr<ServerPlayer> player) { int x, int z, std::shared_ptr<ServerPlayer> player) {
int64_t id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32); int64_t id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32);
AUTO_VAR(it, chunks.find(id)); auto it = chunks.find(id);
if (it != chunks.end()) { if (it != chunks.end()) {
it->second->add(player); it->second->add(player);
@ -503,14 +503,14 @@ void PlayerChunkMap::getChunkAndAddPlayer(
// there. Otherwise attempt to remove from main chunk map. // there. Otherwise attempt to remove from main chunk map.
void PlayerChunkMap::getChunkAndRemovePlayer( void PlayerChunkMap::getChunkAndRemovePlayer(
int x, int z, std::shared_ptr<ServerPlayer> player) { int x, int z, std::shared_ptr<ServerPlayer> player) {
for (AUTO_VAR(it, addRequests.begin()); it != addRequests.end(); it++) { for (auto it = addRequests.begin(); it != addRequests.end(); it++) {
if ((it->x == x) && (it->z == z) && (it->player == player)) { if ((it->x == x) && (it->z == z) && (it->player == player)) {
addRequests.erase(it); addRequests.erase(it);
return; return;
} }
} }
int64_t id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32); int64_t id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32);
AUTO_VAR(it, chunks.find(id)); auto it = chunks.find(id);
if (it != chunks.end()) { if (it != chunks.end()) {
it->second->remove(player); it->second->remove(player);
@ -526,8 +526,8 @@ void PlayerChunkMap::tickAddRequests(std::shared_ptr<ServerPlayer> player) {
int pz = (int)player->z; int pz = (int)player->z;
int minDistSq = -1; int minDistSq = -1;
AUTO_VAR(itNearest, addRequests.end()); auto itNearest = addRequests.end();
for (AUTO_VAR(it, addRequests.begin()); it != addRequests.end(); it++) { for (auto it = addRequests.begin(); it != addRequests.end(); it++) {
if (it->player == player) { if (it->player == player) {
int xm = (it->x * 16) + 8; int xm = (it->x * 16) + 8;
int zm = (it->z * 16) + 8; int zm = (it->z * 16) + 8;
@ -693,13 +693,13 @@ void PlayerChunkMap::remove(std::shared_ptr<ServerPlayer> player) {
if (playerChunk != NULL) playerChunk->remove(player); if (playerChunk != NULL) playerChunk->remove(player);
} }
AUTO_VAR(it, find(players.begin(), players.end(), player)); auto it = find(players.begin(), players.end(), player);
if (players.size() > 0 && it != players.end()) if (players.size() > 0 && it != players.end())
players.erase(find(players.begin(), players.end(), player)); players.erase(find(players.begin(), players.end(), player));
// 4J - added - also remove any queued requests to be added to playerchunks // 4J - added - also remove any queued requests to be added to playerchunks
// here // here
for (AUTO_VAR(it, addRequests.begin()); it != addRequests.end();) { for (auto it = addRequests.begin(); it != addRequests.end();) {
if (it->player == player) { if (it->player == player) {
it = addRequests.erase(it); it = addRequests.erase(it);
} else { } else {
@ -764,10 +764,10 @@ bool PlayerChunkMap::isPlayerIn(std::shared_ptr<ServerPlayer> player,
if (chunk == NULL) { if (chunk == NULL) {
return false; return false;
} else { } else {
AUTO_VAR(it1, auto it1 =
find(chunk->players.begin(), chunk->players.end(), player)); find(chunk->players.begin(), chunk->players.end(), player);
AUTO_VAR(it2, find(player->chunksToSend.begin(), auto it2 = find(player->chunksToSend.begin(),
player->chunksToSend.end(), chunk->pos)); player->chunksToSend.end(), chunk->pos);
return it1 != chunk->players.end() && it2 == player->chunksToSend.end(); return it1 != chunk->players.end() && it2 == player->chunksToSend.end();
} }

View file

@ -851,8 +851,8 @@ void PlayerConnection::handleTextureAndGeometry(
void PlayerConnection::handleTextureReceived(const std::wstring& textureName) { void PlayerConnection::handleTextureReceived(const std::wstring& textureName) {
// This sends the server received texture out to any other players waiting // This sends the server received texture out to any other players waiting
// for the data // for the data
AUTO_VAR(it, find(m_texturesRequested.begin(), m_texturesRequested.end(), auto it = find(m_texturesRequested.begin(), m_texturesRequested.end(),
textureName)); textureName);
if (it != m_texturesRequested.end()) { if (it != m_texturesRequested.end()) {
std::uint8_t* pbData = NULL; std::uint8_t* pbData = NULL;
unsigned int dwBytes = 0; unsigned int dwBytes = 0;
@ -870,8 +870,8 @@ void PlayerConnection::handleTextureAndGeometryReceived(
const std::wstring& textureName) { const std::wstring& textureName) {
// This sends the server received texture out to any other players waiting // This sends the server received texture out to any other players waiting
// for the data // for the data
AUTO_VAR(it, find(m_texturesRequested.begin(), m_texturesRequested.end(), auto it = find(m_texturesRequested.begin(), m_texturesRequested.end(),
textureName)); textureName);
if (it != m_texturesRequested.end()) { if (it != m_texturesRequested.end()) {
std::uint8_t* pbData = NULL; std::uint8_t* pbData = NULL;
unsigned int dwTextureBytes = 0; unsigned int dwTextureBytes = 0;
@ -1270,7 +1270,7 @@ void PlayerConnection::handleSetCreativeModeSlot(
void PlayerConnection::handleContainerAck( void PlayerConnection::handleContainerAck(
std::shared_ptr<ContainerAckPacket> packet) { std::shared_ptr<ContainerAckPacket> packet) {
AUTO_VAR(it, expectedAcks.find(player->containerMenu->containerId)); auto it = expectedAcks.find(player->containerMenu->containerId);
if (it != expectedAcks.end() && packet->uid == it->second && if (it != expectedAcks.end() && packet->uid == it->second &&
player->containerMenu->containerId == packet->containerId && player->containerMenu->containerId == packet->containerId &&
@ -1335,7 +1335,7 @@ void PlayerConnection::handlePlayerInfo(
player->isModerator()) { player->isModerator()) {
std::shared_ptr<ServerPlayer> serverPlayer; std::shared_ptr<ServerPlayer> serverPlayer;
// Find the player being edited // Find the player being edited
for (AUTO_VAR(it, server->getPlayers()->players.begin()); for (auto it = server->getPlayers()->players.begin();
it != server->getPlayers()->players.end(); ++it) { it != server->getPlayers()->players.end(); ++it) {
std::shared_ptr<ServerPlayer> checkingPlayer = *it; std::shared_ptr<ServerPlayer> checkingPlayer = *it;
if (checkingPlayer->connection->getNetworkPlayer() != NULL && if (checkingPlayer->connection->getNetworkPlayer() != NULL &&

View file

@ -54,7 +54,7 @@ PlayerList::PlayerList(MinecraftServer* server) {
} }
PlayerList::~PlayerList() { PlayerList::~PlayerList() {
for (AUTO_VAR(it, players.begin()); it < players.end(); it++) { for (auto it = players.begin(); it < players.end(); it++) {
(*it)->connection = nullptr; // Must remove reference to connection, or (*it)->connection = nullptr; // Must remove reference to connection, or
// else there is a circular dependency // else there is a circular dependency
delete (*it)->gameMode; // Gamemode also needs deleted as it references delete (*it)->gameMode; // Gamemode also needs deleted as it references
@ -100,7 +100,7 @@ void PlayerList::placeNewPlayer(Connection* connection,
{ {
bool usedIndexes[MINECRAFT_NET_MAX_PLAYERS]; bool usedIndexes[MINECRAFT_NET_MAX_PLAYERS];
ZeroMemory(&usedIndexes, MINECRAFT_NET_MAX_PLAYERS * sizeof(bool)); ZeroMemory(&usedIndexes, MINECRAFT_NET_MAX_PLAYERS * sizeof(bool));
for (AUTO_VAR(it, players.begin()); it < players.end(); ++it) { for (auto it = players.begin(); it < players.end(); ++it) {
usedIndexes[(int)(*it)->getPlayerIndex()] = true; usedIndexes[(int)(*it)->getPlayerIndex()] = true;
} }
for (unsigned int i = 0; i < MINECRAFT_NET_MAX_PLAYERS; ++i) { for (unsigned int i = 0; i < MINECRAFT_NET_MAX_PLAYERS; ++i) {
@ -267,8 +267,8 @@ void PlayerList::placeNewPlayer(Connection* connection,
level->getGameTime(), level->getDayTime(), level->getGameTime(), level->getDayTime(),
level->getGameRules()->getBoolean(GameRules::RULE_DAYLIGHT)))); level->getGameRules()->getBoolean(GameRules::RULE_DAYLIGHT))));
AUTO_VAR(activeEffects, player->getActiveEffects()); auto activeEffects = player->getActiveEffects();
for (AUTO_VAR(it, activeEffects->begin()); it != activeEffects->end(); for (auto it = activeEffects->begin(); it != activeEffects->end();
++it) { ++it) {
MobEffectInstance* effect = *it; MobEffectInstance* effect = *it;
playerConnection->send(std::shared_ptr<UpdateMobEffectPacket>( playerConnection->send(std::shared_ptr<UpdateMobEffectPacket>(
@ -294,7 +294,7 @@ void PlayerList::placeNewPlayer(Connection* connection,
// to true so that respawning works when the EndPoem is closed // to true so that respawning works when the EndPoem is closed
INetworkPlayer* thisPlayer = player->connection->getNetworkPlayer(); INetworkPlayer* thisPlayer = player->connection->getNetworkPlayer();
if (thisPlayer != NULL) { if (thisPlayer != NULL) {
for (AUTO_VAR(it, players.begin()); it != players.end(); ++it) { for (auto it = players.begin(); it != players.end(); ++it) {
std::shared_ptr<ServerPlayer> servPlayer = *it; std::shared_ptr<ServerPlayer> servPlayer = *it;
INetworkPlayer* checkPlayer = INetworkPlayer* checkPlayer =
servPlayer->connection->getNetworkPlayer(); servPlayer->connection->getNetworkPlayer();
@ -521,7 +521,7 @@ void PlayerList::remove(std::shared_ptr<ServerPlayer> player) {
} }
level->removeEntity(player); level->removeEntity(player);
level->getChunkMap()->remove(player); level->getChunkMap()->remove(player);
AUTO_VAR(it, find(players.begin(), players.end(), player)); auto it = find(players.begin(), players.end(), player);
if (it != players.end()) { if (it != players.end()) {
players.erase(it); players.erase(it);
} }
@ -632,7 +632,7 @@ std::shared_ptr<ServerPlayer> PlayerList::respawn(
} }
serverPlayer->getLevel()->getChunkMap()->remove(serverPlayer); serverPlayer->getLevel()->getChunkMap()->remove(serverPlayer);
AUTO_VAR(it, find(players.begin(), players.end(), serverPlayer)); auto it = find(players.begin(), players.end(), serverPlayer);
if (it != players.end()) { if (it != players.end()) {
players.erase(it); players.erase(it);
} }
@ -752,7 +752,7 @@ std::shared_ptr<ServerPlayer> PlayerList::respawn(
if (keepAllPlayerData) { if (keepAllPlayerData) {
std::vector<MobEffectInstance*>* activeEffects = std::vector<MobEffectInstance*>* activeEffects =
player->getActiveEffects(); player->getActiveEffects();
for (AUTO_VAR(it, activeEffects->begin()); it != activeEffects->end(); for (auto it = activeEffects->begin(); it != activeEffects->end();
++it) { ++it) {
MobEffectInstance* effect = *it; MobEffectInstance* effect = *it;
@ -893,7 +893,7 @@ void PlayerList::toggleDimension(std::shared_ptr<ServerPlayer> player,
// 4J Stu - Fix for #64683 - Customer Encountered: TU7: Content: Gameplay: // 4J Stu - Fix for #64683 - Customer Encountered: TU7: Content: Gameplay:
// Potion effects are removed after using the Nether Portal // Potion effects are removed after using the Nether Portal
std::vector<MobEffectInstance*>* activeEffects = player->getActiveEffects(); std::vector<MobEffectInstance*>* activeEffects = player->getActiveEffects();
for (AUTO_VAR(it, activeEffects->begin()); it != activeEffects->end(); for (auto it = activeEffects->begin(); it != activeEffects->end();
++it) { ++it) {
MobEffectInstance* effect = *it; MobEffectInstance* effect = *it;
@ -1409,7 +1409,7 @@ int PlayerList::getPlayerCount() { return (int)players.size(); }
int PlayerList::getPlayerCount(ServerLevel* level) { int PlayerList::getPlayerCount(ServerLevel* level) {
int count = 0; int count = 0;
for (AUTO_VAR(it, players.begin()); it != players.end(); ++it) { for (auto it = players.begin(); it != players.end(); ++it) {
if ((*it)->level == level) ++count; if ((*it)->level == level) ++count;
} }
@ -1455,7 +1455,7 @@ std::shared_ptr<ServerPlayer> PlayerList::findAlivePlayerOnSystem(
INetworkPlayer* thisPlayer = player->connection->getNetworkPlayer(); INetworkPlayer* thisPlayer = player->connection->getNetworkPlayer();
if (thisPlayer != NULL) { if (thisPlayer != NULL) {
for (AUTO_VAR(itP, players.begin()); itP != players.end(); ++itP) { for (auto itP = players.begin(); itP != players.end(); ++itP) {
std::shared_ptr<ServerPlayer> newPlayer = *itP; std::shared_ptr<ServerPlayer> newPlayer = *itP;
INetworkPlayer* otherPlayer = INetworkPlayer* otherPlayer =
@ -1488,8 +1488,8 @@ void PlayerList::removePlayerFromReceiving(std::shared_ptr<ServerPlayer> player,
#endif #endif
bool playerRemoved = false; bool playerRemoved = false;
AUTO_VAR(it, find(receiveAllPlayers[dimIndex].begin(), auto it = find(receiveAllPlayers[dimIndex].begin(),
receiveAllPlayers[dimIndex].end(), player)); receiveAllPlayers[dimIndex].end(), player);
if (it != receiveAllPlayers[dimIndex].end()) { if (it != receiveAllPlayers[dimIndex].end()) {
#if !defined(_CONTENT_PACKAGE) #if !defined(_CONTENT_PACKAGE)
app.DebugPrintf( app.DebugPrintf(
@ -1502,7 +1502,7 @@ void PlayerList::removePlayerFromReceiving(std::shared_ptr<ServerPlayer> player,
INetworkPlayer* thisPlayer = player->connection->getNetworkPlayer(); INetworkPlayer* thisPlayer = player->connection->getNetworkPlayer();
if (thisPlayer != NULL && playerRemoved) { if (thisPlayer != NULL && playerRemoved) {
for (AUTO_VAR(itP, players.begin()); itP != players.end(); ++itP) { for (auto itP = players.begin(); itP != players.end(); ++itP) {
std::shared_ptr<ServerPlayer> newPlayer = *itP; std::shared_ptr<ServerPlayer> newPlayer = *itP;
INetworkPlayer* otherPlayer = INetworkPlayer* otherPlayer =
@ -1528,7 +1528,7 @@ void PlayerList::removePlayerFromReceiving(std::shared_ptr<ServerPlayer> player,
// 4J Stu - Something went wrong, or possibly the QNet player left // 4J Stu - Something went wrong, or possibly the QNet player left
// before we got here. Re-check all active players and make sure they // before we got here. Re-check all active players and make sure they
// have someone on their system to receive all packets // have someone on their system to receive all packets
for (AUTO_VAR(itP, players.begin()); itP != players.end(); ++itP) { for (auto itP = players.begin(); itP != players.end(); ++itP) {
std::shared_ptr<ServerPlayer> newPlayer = *itP; std::shared_ptr<ServerPlayer> newPlayer = *itP;
INetworkPlayer* checkingPlayer = INetworkPlayer* checkingPlayer =
newPlayer->connection->getNetworkPlayer(); newPlayer->connection->getNetworkPlayer();
@ -1540,7 +1540,7 @@ void PlayerList::removePlayerFromReceiving(std::shared_ptr<ServerPlayer> player,
else if (newPlayer->dimension == 1) else if (newPlayer->dimension == 1)
newPlayerDim = 2; newPlayerDim = 2;
bool foundPrimary = false; bool foundPrimary = false;
for (AUTO_VAR(it, receiveAllPlayers[newPlayerDim].begin()); for (auto it = receiveAllPlayers[newPlayerDim].begin();
it != receiveAllPlayers[newPlayerDim].end(); ++it) { it != receiveAllPlayers[newPlayerDim].end(); ++it) {
std::shared_ptr<ServerPlayer> primaryPlayer = *it; std::shared_ptr<ServerPlayer> primaryPlayer = *it;
INetworkPlayer* primPlayer = INetworkPlayer* primPlayer =
@ -1589,7 +1589,7 @@ void PlayerList::addPlayerToReceiving(std::shared_ptr<ServerPlayer> player) {
#endif #endif
shouldAddPlayer = false; shouldAddPlayer = false;
} else { } else {
for (AUTO_VAR(it, receiveAllPlayers[playerDim].begin()); for (auto it = receiveAllPlayers[playerDim].begin();
it != receiveAllPlayers[playerDim].end(); ++it) { it != receiveAllPlayers[playerDim].end(); ++it) {
std::shared_ptr<ServerPlayer> oldPlayer = *it; std::shared_ptr<ServerPlayer> oldPlayer = *it;
INetworkPlayer* checkingPlayer = INetworkPlayer* checkingPlayer =
@ -1617,7 +1617,7 @@ bool PlayerList::canReceiveAllPackets(std::shared_ptr<ServerPlayer> player) {
playerDim = 1; playerDim = 1;
else if (player->dimension == 1) else if (player->dimension == 1)
playerDim = 2; playerDim = 2;
for (AUTO_VAR(it, receiveAllPlayers[playerDim].begin()); for (auto it = receiveAllPlayers[playerDim].begin();
it != receiveAllPlayers[playerDim].end(); ++it) { it != receiveAllPlayers[playerDim].end(); ++it) {
std::shared_ptr<ServerPlayer> newPlayer = *it; std::shared_ptr<ServerPlayer> newPlayer = *it;
if (newPlayer == player) { if (newPlayer == player) {
@ -1644,7 +1644,7 @@ bool PlayerList::isXuidBanned(PlayerUID xuid) {
bool banned = false; bool banned = false;
for (AUTO_VAR(it, m_bannedXuids.begin()); it != m_bannedXuids.end(); ++it) { for (auto it = m_bannedXuids.begin(); it != m_bannedXuids.end(); ++it) {
if (ProfileManager.AreXUIDSEqual(xuid, *it)) { if (ProfileManager.AreXUIDSEqual(xuid, *it)) {
banned = true; banned = true;
break; break;

View file

@ -56,8 +56,8 @@ ServerChunkCache::~ServerChunkCache() {
delete m_unloadedCache; delete m_unloadedCache;
#endif #endif
AUTO_VAR(itEnd, m_loadedChunkList.end()); auto itEnd = m_loadedChunkList.end();
for (AUTO_VAR(it, m_loadedChunkList.begin()); it != itEnd; it++) delete *it; for (auto it = m_loadedChunkList.begin(); it != itEnd; it++) delete *it;
DeleteCriticalSection(&m_csLoadCreate); DeleteCriticalSection(&m_csLoadCreate);
} }
@ -654,7 +654,7 @@ bool ServerChunkCache::saveAllEntities() {
PIXBeginNamedEvent(0, "saving to NBT"); PIXBeginNamedEvent(0, "saving to NBT");
EnterCriticalSection(&m_csLoadCreate); EnterCriticalSection(&m_csLoadCreate);
for (AUTO_VAR(it, m_loadedChunkList.begin()); it != m_loadedChunkList.end(); for (auto it = m_loadedChunkList.begin(); it != m_loadedChunkList.end();
++it) { ++it) {
storage->saveEntities(level, *it); storage->saveEntities(level, *it);
} }
@ -676,8 +676,8 @@ bool ServerChunkCache::save(bool force, ProgressListener* progressListener) {
// 4J - added this to support progressListner // 4J - added this to support progressListner
int count = 0; int count = 0;
if (progressListener != NULL) { if (progressListener != NULL) {
AUTO_VAR(itEnd, m_loadedChunkList.end()); auto itEnd = m_loadedChunkList.end();
for (AUTO_VAR(it, m_loadedChunkList.begin()); it != itEnd; it++) { for (auto it = m_loadedChunkList.begin(); it != itEnd; it++) {
LevelChunk* chunk = *it; LevelChunk* chunk = *it;
if (chunk->shouldSave(force)) { if (chunk->shouldSave(force)) {
count++; count++;
@ -813,8 +813,8 @@ bool ServerChunkCache::tick() {
// loadedChunks.remove(cp); // loadedChunks.remove(cp);
// loadedChunkList.remove(chunk); // loadedChunkList.remove(chunk);
AUTO_VAR(it, find(m_loadedChunkList.begin(), auto it = find(m_loadedChunkList.begin(),
m_loadedChunkList.end(), chunk)); m_loadedChunkList.end(), chunk);
if (it != m_loadedChunkList.end()) if (it != m_loadedChunkList.end())
m_loadedChunkList.erase(it); m_loadedChunkList.erase(it);

View file

@ -57,7 +57,7 @@ void ServerCommandDispatcher::logAdminCommand(
int customData, const std::wstring& additionalMessage) { int customData, const std::wstring& additionalMessage) {
PlayerList* playerList = MinecraftServer::getInstance()->getPlayers(); PlayerList* playerList = MinecraftServer::getInstance()->getPlayers();
// for (Player player : MinecraftServer.getInstance().getPlayers().players) // for (Player player : MinecraftServer.getInstance().getPlayers().players)
for (AUTO_VAR(it, playerList->players.begin()); for (auto it = playerList->players.begin();
it != playerList->players.end(); ++it) { it != playerList->players.end(); ++it) {
std::shared_ptr<ServerPlayer> player = *it; std::shared_ptr<ServerPlayer> player = *it;
if (player != source && playerList->isOp(player)) { if (player != source && playerList->isOp(player)) {

View file

@ -102,8 +102,8 @@ void ServerConnection::tick() {
bool ServerConnection::addPendingTextureRequest( bool ServerConnection::addPendingTextureRequest(
const std::wstring& textureName) { const std::wstring& textureName) {
AUTO_VAR(it, find(m_pendingTextureRequests.begin(), auto it = find(m_pendingTextureRequests.begin(),
m_pendingTextureRequests.end(), textureName)); m_pendingTextureRequests.end(), textureName);
if (it == m_pendingTextureRequests.end()) { if (it == m_pendingTextureRequests.end()) {
m_pendingTextureRequests.push_back(textureName); m_pendingTextureRequests.push_back(textureName);
return true; return true;
@ -119,8 +119,8 @@ bool ServerConnection::addPendingTextureRequest(
} }
void ServerConnection::handleTextureReceived(const std::wstring& textureName) { void ServerConnection::handleTextureReceived(const std::wstring& textureName) {
AUTO_VAR(it, find(m_pendingTextureRequests.begin(), auto it = find(m_pendingTextureRequests.begin(),
m_pendingTextureRequests.end(), textureName)); m_pendingTextureRequests.end(), textureName);
if (it != m_pendingTextureRequests.end()) { if (it != m_pendingTextureRequests.end()) {
m_pendingTextureRequests.erase(it); m_pendingTextureRequests.erase(it);
} }
@ -134,8 +134,8 @@ void ServerConnection::handleTextureReceived(const std::wstring& textureName) {
void ServerConnection::handleTextureAndGeometryReceived( void ServerConnection::handleTextureAndGeometryReceived(
const std::wstring& textureName) { const std::wstring& textureName) {
AUTO_VAR(it, find(m_pendingTextureRequests.begin(), auto it = find(m_pendingTextureRequests.begin(),
m_pendingTextureRequests.end(), textureName)); m_pendingTextureRequests.end(), textureName);
if (it != m_pendingTextureRequests.end()) { if (it != m_pendingTextureRequests.end()) {
m_pendingTextureRequests.erase(it); m_pendingTextureRequests.erase(it);
} }

View file

@ -1909,7 +1909,7 @@ void ConsoleSoundEngine::tick() {
return; return;
} }
for (AUTO_VAR(it, scheduledSounds.begin()); it != scheduledSounds.end();) { for (auto it = scheduledSounds.begin(); it != scheduledSounds.end();) {
SoundEngine::ScheduledSound* next = *it; SoundEngine::ScheduledSound* next = *it;
next->delay--; next->delay--;

View file

@ -355,14 +355,14 @@ void ColourTable::loadColoursFromData(std::uint8_t* pbData,
std::wstring colourId = dis.readUTF(); std::wstring colourId = dis.readUTF();
int colourValue = dis.readInt(); int colourValue = dis.readInt();
setColour(colourId, colourValue); setColour(colourId, colourValue);
AUTO_VAR(it, s_colourNamesMap.find(colourId)); auto it = s_colourNamesMap.find(colourId);
} }
bais.reset(); bais.reset();
} }
void ColourTable::setColour(const std::wstring& colourName, int value) { void ColourTable::setColour(const std::wstring& colourName, int value) {
AUTO_VAR(it, s_colourNamesMap.find(colourName)); auto it = s_colourNamesMap.find(colourName);
if (it != s_colourNamesMap.end()) { if (it != s_colourNamesMap.end()) {
m_colourValues[(int)it->second] = value; m_colourValues[(int)it->second] = value;
} }

View file

@ -1127,7 +1127,7 @@ void CMinecraftApp::ActionGameSettings(int iPad, eGameSetting eVal) {
PlayerList* players = PlayerList* players =
MinecraftServer::getInstance()->getPlayerList(); MinecraftServer::getInstance()->getPlayerList();
for (AUTO_VAR(it3, players->players.begin()); for (auto it3 = players->players.begin();
it3 != players->players.end(); ++it3) { it3 != players->players.end(); ++it3) {
std::shared_ptr<ServerPlayer> decorationPlayer = *it3; std::shared_ptr<ServerPlayer> decorationPlayer = *it3;
decorationPlayer->setShowOnMaps( decorationPlayer->setShowOnMaps(
@ -4564,7 +4564,7 @@ bool CMinecraftApp::isXuidNotch(PlayerUID xuid) {
} }
bool CMinecraftApp::isXuidDeadmau5(PlayerUID xuid) { bool CMinecraftApp::isXuidDeadmau5(PlayerUID xuid) {
AUTO_VAR(it, MojangData.find(xuid)); // 4J Stu - The .at and [] accessors auto it = MojangData.find(xuid); // 4J Stu - The .at and [] accessors
// insert elements if they don't exist // insert elements if they don't exist
if (it != MojangData.end()) { if (it != MojangData.end()) {
MOJANG_DATA* pMojangData = MojangData[xuid]; MOJANG_DATA* pMojangData = MojangData[xuid];
@ -4582,7 +4582,7 @@ void CMinecraftApp::AddMemoryTextureFile(const std::wstring& wName,
EnterCriticalSection(&csMemFilesLock); EnterCriticalSection(&csMemFilesLock);
// check it's not already in // check it's not already in
PMEMDATA pData = NULL; PMEMDATA pData = NULL;
AUTO_VAR(it, m_MEM_Files.find(wName)); auto it = m_MEM_Files.find(wName);
if (it != m_MEM_Files.end()) { if (it != m_MEM_Files.end()) {
#if !defined(_CONTENT_PACKAGE) #if !defined(_CONTENT_PACKAGE)
wprintf(L"Incrementing the memory texture file count for %ls\n", wprintf(L"Incrementing the memory texture file count for %ls\n",
@ -4625,7 +4625,7 @@ void CMinecraftApp::AddMemoryTextureFile(const std::wstring& wName,
void CMinecraftApp::RemoveMemoryTextureFile(const std::wstring& wName) { void CMinecraftApp::RemoveMemoryTextureFile(const std::wstring& wName) {
EnterCriticalSection(&csMemFilesLock); EnterCriticalSection(&csMemFilesLock);
AUTO_VAR(it, m_MEM_Files.find(wName)); auto it = m_MEM_Files.find(wName);
if (it != m_MEM_Files.end()) { if (it != m_MEM_Files.end()) {
#if !defined(_CONTENT_PACKAGE) #if !defined(_CONTENT_PACKAGE)
wprintf(L"Decrementing the memory texture file count for %ls\n", wprintf(L"Decrementing the memory texture file count for %ls\n",
@ -4650,7 +4650,7 @@ bool CMinecraftApp::DefaultCapeExists() {
bool val = false; bool val = false;
EnterCriticalSection(&csMemFilesLock); EnterCriticalSection(&csMemFilesLock);
AUTO_VAR(it, m_MEM_Files.find(wTex)); auto it = m_MEM_Files.find(wTex);
if (it != m_MEM_Files.end()) val = true; if (it != m_MEM_Files.end()) val = true;
LeaveCriticalSection(&csMemFilesLock); LeaveCriticalSection(&csMemFilesLock);
@ -4661,7 +4661,7 @@ bool CMinecraftApp::IsFileInMemoryTextures(const std::wstring& wName) {
bool val = false; bool val = false;
EnterCriticalSection(&csMemFilesLock); EnterCriticalSection(&csMemFilesLock);
AUTO_VAR(it, m_MEM_Files.find(wName)); auto it = m_MEM_Files.find(wName);
if (it != m_MEM_Files.end()) val = true; if (it != m_MEM_Files.end()) val = true;
LeaveCriticalSection(&csMemFilesLock); LeaveCriticalSection(&csMemFilesLock);
@ -4672,7 +4672,7 @@ void CMinecraftApp::GetMemFileDetails(const std::wstring& wName,
std::uint8_t** ppbData, std::uint8_t** ppbData,
unsigned int* pByteCount) { unsigned int* pByteCount) {
EnterCriticalSection(&csMemFilesLock); EnterCriticalSection(&csMemFilesLock);
AUTO_VAR(it, m_MEM_Files.find(wName)); auto it = m_MEM_Files.find(wName);
if (it != m_MEM_Files.end()) { if (it != m_MEM_Files.end()) {
PMEMDATA pData = (*it).second; PMEMDATA pData = (*it).second;
*ppbData = pData->pbData; *ppbData = pData->pbData;
@ -4686,7 +4686,7 @@ void CMinecraftApp::AddMemoryTPDFile(int iConfig, std::uint8_t* pbData,
EnterCriticalSection(&csMemTPDLock); EnterCriticalSection(&csMemTPDLock);
// check it's not already in // check it's not already in
PMEMDATA pData = NULL; PMEMDATA pData = NULL;
AUTO_VAR(it, m_MEM_TPD.find(iConfig)); auto it = m_MEM_TPD.find(iConfig);
if (it == m_MEM_TPD.end()) { if (it == m_MEM_TPD.end()) {
pData = new MEMDATA(); pData = new MEMDATA();
pData->pbData = pbData; pData->pbData = pbData;
@ -4703,7 +4703,7 @@ void CMinecraftApp::RemoveMemoryTPDFile(int iConfig) {
EnterCriticalSection(&csMemTPDLock); EnterCriticalSection(&csMemTPDLock);
// check it's not already in // check it's not already in
PMEMDATA pData = NULL; PMEMDATA pData = NULL;
AUTO_VAR(it, m_MEM_TPD.find(iConfig)); auto it = m_MEM_TPD.find(iConfig);
if (it != m_MEM_TPD.end()) { if (it != m_MEM_TPD.end()) {
pData = m_MEM_TPD[iConfig]; pData = m_MEM_TPD[iConfig];
delete pData; delete pData;
@ -4720,7 +4720,7 @@ bool CMinecraftApp::IsFileInTPD(int iConfig) {
bool val = false; bool val = false;
EnterCriticalSection(&csMemTPDLock); EnterCriticalSection(&csMemTPDLock);
AUTO_VAR(it, m_MEM_TPD.find(iConfig)); auto it = m_MEM_TPD.find(iConfig);
if (it != m_MEM_TPD.end()) val = true; if (it != m_MEM_TPD.end()) val = true;
LeaveCriticalSection(&csMemTPDLock); LeaveCriticalSection(&csMemTPDLock);
@ -4730,7 +4730,7 @@ bool CMinecraftApp::IsFileInTPD(int iConfig) {
void CMinecraftApp::GetTPD(int iConfig, std::uint8_t** ppbData, void CMinecraftApp::GetTPD(int iConfig, std::uint8_t** ppbData,
unsigned int* pByteCount) { unsigned int* pByteCount) {
EnterCriticalSection(&csMemTPDLock); EnterCriticalSection(&csMemTPDLock);
AUTO_VAR(it, m_MEM_TPD.find(iConfig)); auto it = m_MEM_TPD.find(iConfig);
if (it != m_MEM_TPD.end()) { if (it != m_MEM_TPD.end()) {
PMEMDATA pData = (*it).second; PMEMDATA pData = (*it).second;
*ppbData = pData->pbData; *ppbData = pData->pbData;
@ -5610,7 +5610,7 @@ HRESULT CMinecraftApp::RegisterDLCData(char* pchDLCName,
bool CMinecraftApp::GetDLCFullOfferIDForSkinID(const std::wstring& FirstSkin, bool CMinecraftApp::GetDLCFullOfferIDForSkinID(const std::wstring& FirstSkin,
ULONGLONG* pullVal) { ULONGLONG* pullVal) {
AUTO_VAR(it, DLCInfo_SkinName.find(FirstSkin)); auto it = DLCInfo_SkinName.find(FirstSkin);
if (it == DLCInfo_SkinName.end()) { if (it == DLCInfo_SkinName.end()) {
return false; return false;
} else { } else {
@ -5620,7 +5620,7 @@ bool CMinecraftApp::GetDLCFullOfferIDForSkinID(const std::wstring& FirstSkin,
} }
bool CMinecraftApp::GetDLCFullOfferIDForPackID(const int iPackID, bool CMinecraftApp::GetDLCFullOfferIDForPackID(const int iPackID,
ULONGLONG* pullVal) { ULONGLONG* pullVal) {
AUTO_VAR(it, DLCTextures_PackID.find(iPackID)); auto it = DLCTextures_PackID.find(iPackID);
if (it == DLCTextures_PackID.end()) { if (it == DLCTextures_PackID.end()) {
*pullVal = (ULONGLONG)0; *pullVal = (ULONGLONG)0;
return false; return false;
@ -5632,7 +5632,7 @@ bool CMinecraftApp::GetDLCFullOfferIDForPackID(const int iPackID,
DLC_INFO* CMinecraftApp::GetDLCInfoForTrialOfferID(ULONGLONG ullOfferID_Trial) { DLC_INFO* CMinecraftApp::GetDLCInfoForTrialOfferID(ULONGLONG ullOfferID_Trial) {
// DLC_INFO *pDLCInfo=NULL; // DLC_INFO *pDLCInfo=NULL;
if (DLCInfo_Trial.size() > 0) { if (DLCInfo_Trial.size() > 0) {
AUTO_VAR(it, DLCInfo_Trial.find(ullOfferID_Trial)); auto it = DLCInfo_Trial.find(ullOfferID_Trial);
if (it == DLCInfo_Trial.end()) { if (it == DLCInfo_Trial.end()) {
// nothing for this // nothing for this
@ -5678,7 +5678,7 @@ ULONGLONG CMinecraftApp::GetDLCInfoTexturesFullOffer(int iIndex) {
DLC_INFO* CMinecraftApp::GetDLCInfoForFullOfferID(ULONGLONG ullOfferID_Full) { DLC_INFO* CMinecraftApp::GetDLCInfoForFullOfferID(ULONGLONG ullOfferID_Full) {
if (DLCInfo_Full.size() > 0) { if (DLCInfo_Full.size() > 0) {
AUTO_VAR(it, DLCInfo_Full.find(ullOfferID_Full)); auto it = DLCInfo_Full.find(ullOfferID_Full);
if (it == DLCInfo_Full.end()) { if (it == DLCInfo_Full.end()) {
// nothing for this // nothing for this
@ -5857,7 +5857,7 @@ void CMinecraftApp::AddLevelToBannedLevelList(int iPad, PlayerUID xuid,
static_cast<unsigned int>(sizeof(BANNEDLISTDATA) * bannedListCount); static_cast<unsigned int>(sizeof(BANNEDLISTDATA) * bannedListCount);
PBANNEDLISTDATA pBannedList = new BANNEDLISTDATA[bannedListCount]; PBANNEDLISTDATA pBannedList = new BANNEDLISTDATA[bannedListCount];
int iCount = 0; int iCount = 0;
for (AUTO_VAR(it, m_vBannedListA[iPad]->begin()); for (auto it = m_vBannedListA[iPad]->begin();
it != m_vBannedListA[iPad]->end(); ++it) { it != m_vBannedListA[iPad]->end(); ++it) {
PBANNEDLISTDATA pData = *it; PBANNEDLISTDATA pData = *it;
memcpy(&pBannedList[iCount++], pData, sizeof(BANNEDLISTDATA)); memcpy(&pBannedList[iCount++], pData, sizeof(BANNEDLISTDATA));
@ -5876,7 +5876,7 @@ void CMinecraftApp::AddLevelToBannedLevelList(int iPad, PlayerUID xuid,
bool CMinecraftApp::IsInBannedLevelList(int iPad, PlayerUID xuid, bool CMinecraftApp::IsInBannedLevelList(int iPad, PlayerUID xuid,
char* pszLevelName) { char* pszLevelName) {
for (AUTO_VAR(it, m_vBannedListA[iPad]->begin()); for (auto it = m_vBannedListA[iPad]->begin();
it != m_vBannedListA[iPad]->end(); ++it) { it != m_vBannedListA[iPad]->end(); ++it) {
PBANNEDLISTDATA pData = *it; PBANNEDLISTDATA pData = *it;
if (IsEqualXUID(pData->xuid, xuid) && if (IsEqualXUID(pData->xuid, xuid) &&
@ -5896,7 +5896,7 @@ void CMinecraftApp::RemoveLevelFromBannedLevelList(int iPad, PlayerUID xuid,
// we will have retrieved the banned level list from TMS, so remove this one // we will have retrieved the banned level list from TMS, so remove this one
// from it and write it back to TMS // from it and write it back to TMS
for (AUTO_VAR(it, m_vBannedListA[iPad]->begin()); for (auto it = m_vBannedListA[iPad]->begin();
it != m_vBannedListA[iPad]->end();) { it != m_vBannedListA[iPad]->end();) {
PBANNEDLISTDATA pBannedListData = *it; PBANNEDLISTDATA pBannedListData = *it;
@ -6507,7 +6507,7 @@ unsigned int CMinecraftApp::CreateImageTextData(std::uint8_t* textMetadata,
void CMinecraftApp::AddTerrainFeaturePosition(_eTerrainFeatureType eFeatureType, void CMinecraftApp::AddTerrainFeaturePosition(_eTerrainFeatureType eFeatureType,
int x, int z) { int x, int z) {
// check we don't already have this in // check we don't already have this in
for (AUTO_VAR(it, m_vTerrainFeatures.begin()); for (auto it = m_vTerrainFeatures.begin();
it < m_vTerrainFeatures.end(); ++it) { it < m_vTerrainFeatures.end(); ++it) {
FEATURE_DATA* pFeatureData = *it; FEATURE_DATA* pFeatureData = *it;
@ -6525,7 +6525,7 @@ void CMinecraftApp::AddTerrainFeaturePosition(_eTerrainFeatureType eFeatureType,
} }
_eTerrainFeatureType CMinecraftApp::IsTerrainFeature(int x, int z) { _eTerrainFeatureType CMinecraftApp::IsTerrainFeature(int x, int z) {
for (AUTO_VAR(it, m_vTerrainFeatures.begin()); for (auto it = m_vTerrainFeatures.begin();
it < m_vTerrainFeatures.end(); ++it) { it < m_vTerrainFeatures.end(); ++it) {
FEATURE_DATA* pFeatureData = *it; FEATURE_DATA* pFeatureData = *it;
@ -6538,7 +6538,7 @@ _eTerrainFeatureType CMinecraftApp::IsTerrainFeature(int x, int z) {
bool CMinecraftApp::GetTerrainFeaturePosition(_eTerrainFeatureType eType, bool CMinecraftApp::GetTerrainFeaturePosition(_eTerrainFeatureType eType,
int* pX, int* pZ) { int* pX, int* pZ) {
for (AUTO_VAR(it, m_vTerrainFeatures.begin()); for (auto it = m_vTerrainFeatures.begin();
it < m_vTerrainFeatures.end(); ++it) { it < m_vTerrainFeatures.end(); ++it) {
FEATURE_DATA* pFeatureData = *it; FEATURE_DATA* pFeatureData = *it;
@ -6666,7 +6666,7 @@ unsigned int CMinecraftApp::AddDLCRequest(eDLCMarketplaceType eType,
// If it's already in there, promote it to the top of the list // If it's already in there, promote it to the top of the list
int iPosition = 0; int iPosition = 0;
for (AUTO_VAR(it, m_DLCDownloadQueue.begin()); for (auto it = m_DLCDownloadQueue.begin();
it != m_DLCDownloadQueue.end(); ++it) { it != m_DLCDownloadQueue.end(); ++it) {
DLCRequest* pCurrent = *it; DLCRequest* pCurrent = *it;
@ -6717,7 +6717,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType,
bool bPromoted=false; bool bPromoted=false;
for(AUTO_VAR(it, m_TMSPPDownloadQueue.begin()); it != for(auto it = m_TMSPPDownloadQueue.begin(); it !=
m_TMSPPDownloadQueue.end(); ++it) m_TMSPPDownloadQueue.end(); ++it)
{ {
TMSPPRequest *pCurrent = *it; TMSPPRequest *pCurrent = *it;
@ -6776,7 +6776,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType,
// of a previous trial/full offer // of a previous trial/full offer
bool bAlreadyInQueue = false; bool bAlreadyInQueue = false;
for (AUTO_VAR(it, m_TMSPPDownloadQueue.begin()); for (auto it = m_TMSPPDownloadQueue.begin();
it != m_TMSPPDownloadQueue.end(); ++it) { it != m_TMSPPDownloadQueue.end(); ++it) {
TMSPPRequest* pCurrent = *it; TMSPPRequest* pCurrent = *it;
@ -6843,7 +6843,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType,
// a previous trial/full offer // a previous trial/full offer
bool bAlreadyInQueue = false; bool bAlreadyInQueue = false;
for (AUTO_VAR(it, m_TMSPPDownloadQueue.begin()); for (auto it = m_TMSPPDownloadQueue.begin();
it != m_TMSPPDownloadQueue.end(); ++it) { it != m_TMSPPDownloadQueue.end(); ++it) {
TMSPPRequest* pCurrent = *it; TMSPPRequest* pCurrent = *it;
@ -6895,7 +6895,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType,
bool CMinecraftApp::CheckTMSDLCCanStop() { bool CMinecraftApp::CheckTMSDLCCanStop() {
EnterCriticalSection(&csTMSPPDownloadQueue); EnterCriticalSection(&csTMSPPDownloadQueue);
for (AUTO_VAR(it, m_TMSPPDownloadQueue.begin()); for (auto it = m_TMSPPDownloadQueue.begin();
it != m_TMSPPDownloadQueue.end(); ++it) { it != m_TMSPPDownloadQueue.end(); ++it) {
TMSPPRequest* pCurrent = *it; TMSPPRequest* pCurrent = *it;
@ -6921,7 +6921,7 @@ bool CMinecraftApp::RetrieveNextDLCContent() {
} }
EnterCriticalSection(&csDLCDownloadQueue); EnterCriticalSection(&csDLCDownloadQueue);
for (AUTO_VAR(it, m_DLCDownloadQueue.begin()); for (auto it = m_DLCDownloadQueue.begin();
it != m_DLCDownloadQueue.end(); ++it) { it != m_DLCDownloadQueue.end(); ++it) {
DLCRequest* pCurrent = *it; DLCRequest* pCurrent = *it;
@ -6932,7 +6932,7 @@ bool CMinecraftApp::RetrieveNextDLCContent() {
} }
// Now look for the next retrieval // Now look for the next retrieval
for (AUTO_VAR(it, m_DLCDownloadQueue.begin()); for (auto it = m_DLCDownloadQueue.begin();
it != m_DLCDownloadQueue.end(); ++it) { it != m_DLCDownloadQueue.end(); ++it) {
DLCRequest* pCurrent = *it; DLCRequest* pCurrent = *it;
@ -6970,7 +6970,7 @@ int CMinecraftApp::TMSPPFileReturned(void* pParam, int iPad, int iUserData,
// find the right one in the vector // find the right one in the vector
EnterCriticalSection(&pClass->csTMSPPDownloadQueue); EnterCriticalSection(&pClass->csTMSPPDownloadQueue);
for (AUTO_VAR(it, pClass->m_TMSPPDownloadQueue.begin()); for (auto it = pClass->m_TMSPPDownloadQueue.begin();
it != pClass->m_TMSPPDownloadQueue.end(); ++it) { it != pClass->m_TMSPPDownloadQueue.end(); ++it) {
TMSPPRequest* pCurrent = *it; TMSPPRequest* pCurrent = *it;
#if defined(_WINDOWS64) #if defined(_WINDOWS64)
@ -7030,7 +7030,7 @@ void CMinecraftApp::ClearAndResetDLCDownloadQueue() {
int iPosition = 0; int iPosition = 0;
EnterCriticalSection(&csTMSPPDownloadQueue); EnterCriticalSection(&csTMSPPDownloadQueue);
for (AUTO_VAR(it, m_DLCDownloadQueue.begin()); for (auto it = m_DLCDownloadQueue.begin();
it != m_DLCDownloadQueue.end(); ++it) { it != m_DLCDownloadQueue.end(); ++it) {
DLCRequest* pCurrent = *it; DLCRequest* pCurrent = *it;
@ -7052,7 +7052,7 @@ void CMinecraftApp::TickTMSPPFilesRetrieved() {
void CMinecraftApp::ClearTMSPPFilesRetrieved() { void CMinecraftApp::ClearTMSPPFilesRetrieved() {
int iPosition = 0; int iPosition = 0;
EnterCriticalSection(&csTMSPPDownloadQueue); EnterCriticalSection(&csTMSPPDownloadQueue);
for (AUTO_VAR(it, m_TMSPPDownloadQueue.begin()); for (auto it = m_TMSPPDownloadQueue.begin();
it != m_TMSPPDownloadQueue.end(); ++it) { it != m_TMSPPDownloadQueue.end(); ++it) {
TMSPPRequest* pCurrent = *it; TMSPPRequest* pCurrent = *it;
@ -7070,7 +7070,7 @@ int CMinecraftApp::DLCOffersReturned(void* pParam, int iOfferC,
// find the right one in the vector // find the right one in the vector
EnterCriticalSection(&pClass->csTMSPPDownloadQueue); EnterCriticalSection(&pClass->csTMSPPDownloadQueue);
for (AUTO_VAR(it, pClass->m_DLCDownloadQueue.begin()); for (auto it = pClass->m_DLCDownloadQueue.begin();
it != pClass->m_DLCDownloadQueue.end(); ++it) { it != pClass->m_DLCDownloadQueue.end(); ++it) {
DLCRequest* pCurrent = *it; DLCRequest* pCurrent = *it;
@ -7102,7 +7102,7 @@ bool CMinecraftApp::DLCContentRetrieved(eDLCMarketplaceType eType) {
// If there's already a retrieve in progress, quit // If there's already a retrieve in progress, quit
// we may have re-ordered the list, so need to check every item // we may have re-ordered the list, so need to check every item
EnterCriticalSection(&csDLCDownloadQueue); EnterCriticalSection(&csDLCDownloadQueue);
for (AUTO_VAR(it, m_DLCDownloadQueue.begin()); for (auto it = m_DLCDownloadQueue.begin();
it != m_DLCDownloadQueue.end(); ++it) { it != m_DLCDownloadQueue.end(); ++it) {
DLCRequest* pCurrent = *it; DLCRequest* pCurrent = *it;
@ -7168,7 +7168,7 @@ std::vector<ModelPart*>* CMinecraftApp::SetAdditionalSkinBoxes(
dwSkinID & 0x0FFFFFFF); dwSkinID & 0x0FFFFFFF);
// convert the skin boxes into model parts, and add to the humanoid model // convert the skin boxes into model parts, and add to the humanoid model
for (AUTO_VAR(it, pvSkinBoxA->begin()); it != pvSkinBoxA->end(); ++it) { for (auto it = pvSkinBoxA->begin(); it != pvSkinBoxA->end(); ++it) {
if (pModel) { if (pModel) {
ModelPart* pModelPart = pModel->AddOrRetrievePart(*it); ModelPart* pModelPart = pModel->AddOrRetrievePart(*it);
pvModelPart->push_back(pModelPart); pvModelPart->push_back(pModelPart);
@ -7192,7 +7192,7 @@ std::vector<ModelPart*>* CMinecraftApp::GetAdditionalModelParts(
EnterCriticalSection(&csAdditionalModelParts); EnterCriticalSection(&csAdditionalModelParts);
std::vector<ModelPart*>* pvModelParts = NULL; std::vector<ModelPart*>* pvModelParts = NULL;
if (m_AdditionalModelParts.size() > 0) { if (m_AdditionalModelParts.size() > 0) {
AUTO_VAR(it, m_AdditionalModelParts.find(dwSkinID)); auto it = m_AdditionalModelParts.find(dwSkinID);
if (it != m_AdditionalModelParts.end()) { if (it != m_AdditionalModelParts.end()) {
pvModelParts = (*it).second; pvModelParts = (*it).second;
} }
@ -7207,7 +7207,7 @@ std::vector<SKIN_BOX*>* CMinecraftApp::GetAdditionalSkinBoxes(
EnterCriticalSection(&csAdditionalSkinBoxes); EnterCriticalSection(&csAdditionalSkinBoxes);
std::vector<SKIN_BOX*>* pvSkinBoxes = NULL; std::vector<SKIN_BOX*>* pvSkinBoxes = NULL;
if (m_AdditionalSkinBoxes.size() > 0) { if (m_AdditionalSkinBoxes.size() > 0) {
AUTO_VAR(it, m_AdditionalSkinBoxes.find(dwSkinID)); auto it = m_AdditionalSkinBoxes.find(dwSkinID);
if (it != m_AdditionalSkinBoxes.end()) { if (it != m_AdditionalSkinBoxes.end()) {
pvSkinBoxes = (*it).second; pvSkinBoxes = (*it).second;
} }
@ -7222,7 +7222,7 @@ unsigned int CMinecraftApp::GetAnimOverrideBitmask(std::uint32_t dwSkinID) {
unsigned int uiAnimOverrideBitmask = 0L; unsigned int uiAnimOverrideBitmask = 0L;
if (m_AnimOverrides.size() > 0) { if (m_AnimOverrides.size() > 0) {
AUTO_VAR(it, m_AnimOverrides.find(dwSkinID)); auto it = m_AnimOverrides.find(dwSkinID);
if (it != m_AnimOverrides.end()) { if (it != m_AnimOverrides.end()) {
uiAnimOverrideBitmask = (*it).second; uiAnimOverrideBitmask = (*it).second;
} }
@ -7238,7 +7238,7 @@ void CMinecraftApp::SetAnimOverrideBitmask(std::uint32_t dwSkinID,
EnterCriticalSection(&csAnimOverrideBitmask); EnterCriticalSection(&csAnimOverrideBitmask);
if (m_AnimOverrides.size() > 0) { if (m_AnimOverrides.size() > 0) {
AUTO_VAR(it, m_AnimOverrides.find(dwSkinID)); auto it = m_AnimOverrides.find(dwSkinID);
if (it != m_AnimOverrides.end()) { if (it != m_AnimOverrides.end()) {
LeaveCriticalSection(&csAnimOverrideBitmask); LeaveCriticalSection(&csAnimOverrideBitmask);
return; // already in here return; // already in here

View file

@ -227,7 +227,7 @@ bool DLCAudioFile::processDLCDataFile(std::uint8_t* pbData,
for (unsigned int j = 0; j < uiParameterCount; j++) { for (unsigned int j = 0; j < uiParameterCount; j++) {
// EAudioParameterType paramType = e_AudioParamType_Invalid; // EAudioParameterType paramType = e_AudioParamType_Invalid;
AUTO_VAR(it, parameterMapping.find(paramBuf.dwType)); auto it = parameterMapping.find(paramBuf.dwType);
if (it != parameterMapping.end()) { if (it != parameterMapping.end()) {
addParameter(type, (EAudioParameterType)paramBuf.dwType, addParameter(type, (EAudioParameterType)paramBuf.dwType,

View file

@ -151,7 +151,7 @@ DLCManager::DLCManager() {
} }
DLCManager::~DLCManager() { DLCManager::~DLCManager() {
for (AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) { for (auto it = m_packs.begin(); it != m_packs.end(); ++it) {
DLCPack* pack = *it; DLCPack* pack = *it;
delete pack; delete pack;
} }
@ -174,7 +174,7 @@ DLCManager::EDLCParameterType DLCManager::getParameterType(
unsigned int DLCManager::getPackCount(EDLCType type /*= e_DLCType_All*/) { unsigned int DLCManager::getPackCount(EDLCType type /*= e_DLCType_All*/) {
unsigned int packCount = 0; unsigned int packCount = 0;
if (type != e_DLCType_All) { if (type != e_DLCType_All) {
for (AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) { for (auto it = m_packs.begin(); it != m_packs.end(); ++it) {
DLCPack* pack = *it; DLCPack* pack = *it;
if (pack->getDLCItemsCount(type) > 0) { if (pack->getDLCItemsCount(type) > 0) {
++packCount; ++packCount;
@ -190,14 +190,14 @@ void DLCManager::addPack(DLCPack* pack) { m_packs.push_back(pack); }
void DLCManager::removePack(DLCPack* pack) { void DLCManager::removePack(DLCPack* pack) {
if (pack != NULL) { if (pack != NULL) {
AUTO_VAR(it, find(m_packs.begin(), m_packs.end(), pack)); auto it = find(m_packs.begin(), m_packs.end(), pack);
if (it != m_packs.end()) m_packs.erase(it); if (it != m_packs.end()) m_packs.erase(it);
delete pack; delete pack;
} }
} }
void DLCManager::removeAllPacks(void) { void DLCManager::removeAllPacks(void) {
for (AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) { for (auto it = m_packs.begin(); it != m_packs.end(); ++it) {
DLCPack* pack = (DLCPack*)*it; DLCPack* pack = (DLCPack*)*it;
delete pack; delete pack;
} }
@ -206,7 +206,7 @@ void DLCManager::removeAllPacks(void) {
} }
void DLCManager::LanguageChanged(void) { void DLCManager::LanguageChanged(void) {
for (AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) { for (auto it = m_packs.begin(); it != m_packs.end(); ++it) {
DLCPack* pack = (DLCPack*)*it; DLCPack* pack = (DLCPack*)*it;
// update the language // update the language
pack->UpdateLanguage(); pack->UpdateLanguage();
@ -217,7 +217,7 @@ DLCPack* DLCManager::getPack(const std::wstring& name) {
DLCPack* pack = NULL; DLCPack* pack = NULL;
// DWORD currentIndex = 0; // DWORD currentIndex = 0;
DLCPack* currentPack = NULL; DLCPack* currentPack = NULL;
for (AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) { for (auto it = m_packs.begin(); it != m_packs.end(); ++it) {
currentPack = *it; currentPack = *it;
std::wstring wsName = currentPack->getName(); std::wstring wsName = currentPack->getName();
@ -236,7 +236,7 @@ DLCPack* DLCManager::getPack(unsigned int index,
if (type != e_DLCType_All) { if (type != e_DLCType_All) {
unsigned int currentIndex = 0; unsigned int currentIndex = 0;
DLCPack* currentPack = NULL; DLCPack* currentPack = NULL;
for (AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) { for (auto it = m_packs.begin(); it != m_packs.end(); ++it) {
currentPack = *it; currentPack = *it;
if (currentPack->getDLCItemsCount(type) > 0) { if (currentPack->getDLCItemsCount(type) > 0) {
if (currentIndex == index) { if (currentIndex == index) {
@ -271,7 +271,7 @@ unsigned int DLCManager::getPackIndex(DLCPack* pack, bool& found,
} }
if (type != e_DLCType_All) { if (type != e_DLCType_All) {
unsigned int index = 0; unsigned int index = 0;
for (AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) { for (auto it = m_packs.begin(); it != m_packs.end(); ++it) {
DLCPack* thisPack = *it; DLCPack* thisPack = *it;
if (thisPack->getDLCItemsCount(type) > 0) { if (thisPack->getDLCItemsCount(type) > 0) {
if (thisPack == pack) { if (thisPack == pack) {
@ -284,7 +284,7 @@ unsigned int DLCManager::getPackIndex(DLCPack* pack, bool& found,
} }
} else { } else {
unsigned int index = 0; unsigned int index = 0;
for (AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) { for (auto it = m_packs.begin(); it != m_packs.end(); ++it) {
DLCPack* thisPack = *it; DLCPack* thisPack = *it;
if (thisPack == pack) { if (thisPack == pack) {
found = true; found = true;
@ -302,7 +302,7 @@ unsigned int DLCManager::getPackIndexContainingSkin(const std::wstring& path,
unsigned int foundIndex = 0; unsigned int foundIndex = 0;
found = false; found = false;
unsigned int index = 0; unsigned int index = 0;
for (AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) { for (auto it = m_packs.begin(); it != m_packs.end(); ++it) {
DLCPack* pack = *it; DLCPack* pack = *it;
if (pack->getDLCItemsCount(e_DLCType_Skin) > 0) { if (pack->getDLCItemsCount(e_DLCType_Skin) > 0) {
if (pack->doesPackContainSkin(path)) { if (pack->doesPackContainSkin(path)) {
@ -318,7 +318,7 @@ unsigned int DLCManager::getPackIndexContainingSkin(const std::wstring& path,
DLCPack* DLCManager::getPackContainingSkin(const std::wstring& path) { DLCPack* DLCManager::getPackContainingSkin(const std::wstring& path) {
DLCPack* foundPack = NULL; DLCPack* foundPack = NULL;
for (AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) { for (auto it = m_packs.begin(); it != m_packs.end(); ++it) {
DLCPack* pack = *it; DLCPack* pack = *it;
if (pack->getDLCItemsCount(e_DLCType_Skin) > 0) { if (pack->getDLCItemsCount(e_DLCType_Skin) > 0) {
if (pack->doesPackContainSkin(path)) { if (pack->doesPackContainSkin(path)) {
@ -332,7 +332,7 @@ DLCPack* DLCManager::getPackContainingSkin(const std::wstring& path) {
DLCSkinFile* DLCManager::getSkinFile(const std::wstring& path) { DLCSkinFile* DLCManager::getSkinFile(const std::wstring& path) {
DLCSkinFile* foundSkinfile = NULL; DLCSkinFile* foundSkinfile = NULL;
for (AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) { for (auto it = m_packs.begin(); it != m_packs.end(); ++it) {
DLCPack* pack = *it; DLCPack* pack = *it;
foundSkinfile = pack->getSkinFile(path); foundSkinfile = pack->getSkinFile(path);
if (foundSkinfile != NULL) { if (foundSkinfile != NULL) {
@ -348,7 +348,7 @@ unsigned int DLCManager::checkForCorruptDLCAndAlert(
DLCPack* pack = NULL; DLCPack* pack = NULL;
DLCPack* firstCorruptPack = NULL; DLCPack* firstCorruptPack = NULL;
for (AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) { for (auto it = m_packs.begin(); it != m_packs.end(); ++it) {
pack = *it; pack = *it;
if (pack->IsCorrupt()) { if (pack->IsCorrupt()) {
++corruptDLCCount; ++corruptDLCCount;
@ -529,7 +529,7 @@ bool DLCManager::processDLCDataFile(unsigned int& dwFilesProcessed,
// DLCManager::EDLCParameterType paramType = // DLCManager::EDLCParameterType paramType =
// DLCManager::e_DLCParamType_Invalid; // DLCManager::e_DLCParamType_Invalid;
AUTO_VAR(it, parameterMapping.find(parBuf.dwType)); auto it = parameterMapping.find(parBuf.dwType);
if (it != parameterMapping.end()) { if (it != parameterMapping.end()) {
if (type == e_DLCType_PackConfig) { if (type == e_DLCType_PackConfig) {
@ -686,7 +686,7 @@ std::uint32_t DLCManager::retrievePackID(std::uint8_t* pbData,
pbTemp += sizeof(int); pbTemp += sizeof(int);
ReadDlcStruct(&paramBuf, pbTemp); ReadDlcStruct(&paramBuf, pbTemp);
for (unsigned int j = 0; j < uiParameterCount; j++) { for (unsigned int j = 0; j < uiParameterCount; j++) {
AUTO_VAR(it, parameterMapping.find(paramBuf.dwType)); auto it = parameterMapping.find(paramBuf.dwType);
if (it != parameterMapping.end()) { if (it != parameterMapping.end()) {
if (type == e_DLCType_PackConfig) { if (type == e_DLCType_PackConfig) {

View file

@ -29,12 +29,12 @@ DLCPack::DLCPack(const std::wstring& name, std::uint32_t dwLicenseMask) {
DLCPack::~DLCPack() { DLCPack::~DLCPack() {
for (AUTO_VAR(it, m_childPacks.begin()); it != m_childPacks.end(); ++it) { for (auto it = m_childPacks.begin(); it != m_childPacks.end(); ++it) {
delete *it; delete *it;
} }
for (unsigned int i = 0; i < DLCManager::e_DLCType_Max; ++i) { for (unsigned int i = 0; i < DLCManager::e_DLCType_Max; ++i) {
for (AUTO_VAR(it, m_files[i].begin()); it != m_files[i].end(); ++it) { for (auto it = m_files[i].begin(); it != m_files[i].end(); ++it) {
delete *it; delete *it;
} }
} }
@ -122,7 +122,7 @@ void DLCPack::addParameter(DLCManager::EDLCParameterType type,
bool DLCPack::getParameterAsUInt(DLCManager::EDLCParameterType type, bool DLCPack::getParameterAsUInt(DLCManager::EDLCParameterType type,
unsigned int& param) { unsigned int& param) {
AUTO_VAR(it, m_parameters.find((int)type)); auto it = m_parameters.find((int)type);
if (it != m_parameters.end()) { if (it != m_parameters.end()) {
switch (type) { switch (type) {
case DLCManager::e_DLCParamType_NetherParticleColour: case DLCManager::e_DLCParamType_NetherParticleColour:
@ -213,8 +213,8 @@ bool DLCPack::doesPackContainFile(DLCManager::EDLCType type,
} }
} else { } else {
g_pathCmpString = &path; g_pathCmpString = &path;
AUTO_VAR(it, std::find_if(m_files[type].begin(), m_files[type].end(), auto it = std::find_if(m_files[type].begin(), m_files[type].end(),
pathCmp)); pathCmp);
hasFile = it != m_files[type].end(); hasFile = it != m_files[type].end();
if (!hasFile && m_parentPack) { if (!hasFile && m_parentPack) {
hasFile = m_parentPack->doesPackContainFile(type, path); hasFile = m_parentPack->doesPackContainFile(type, path);
@ -252,8 +252,7 @@ DLCFile* DLCPack::getFile(DLCManager::EDLCType type, const std::wstring& path) {
} }
} else { } else {
g_pathCmpString = &path; g_pathCmpString = &path;
AUTO_VAR(it, std::find_if(m_files[type].begin(), m_files[type].end(), auto it = std::find_if(m_files[type].begin(), m_files[type].end(), pathCmp);
pathCmp));
if (it == m_files[type].end()) { if (it == m_files[type].end()) {
// Not found // Not found
@ -298,7 +297,7 @@ unsigned int DLCPack::getFileIndexAt(DLCManager::EDLCType type,
unsigned int foundIndex = 0; unsigned int foundIndex = 0;
found = false; found = false;
unsigned int index = 0; unsigned int index = 0;
for (AUTO_VAR(it, m_files[type].begin()); it != m_files[type].end(); ++it) { for (auto it = m_files[type].begin(); it != m_files[type].end(); ++it) {
if (path.compare((*it)->getPath()) == 0) { if (path.compare((*it)->getPath()) == 0) {
foundIndex = index; foundIndex = index;
found = true; found = true;

View file

@ -34,7 +34,7 @@ void AddItemRuleDefinition::writeAttributes(DataOutputStream* dos,
void AddItemRuleDefinition::getChildren( void AddItemRuleDefinition::getChildren(
std::vector<GameRuleDefinition*>* children) { std::vector<GameRuleDefinition*>* children) {
GameRuleDefinition::getChildren(children); GameRuleDefinition::getChildren(children);
for (AUTO_VAR(it, m_enchantments.begin()); it != m_enchantments.end(); it++) for (auto it = m_enchantments.begin(); it != m_enchantments.end(); it++)
children->push_back(*it); children->push_back(*it);
} }
@ -95,7 +95,7 @@ bool AddItemRuleDefinition::addItemToContainer(
new ItemInstance(m_itemId, quantity, m_auxValue)); new ItemInstance(m_itemId, quantity, m_auxValue));
newItem->set4JData(m_dataTag); newItem->set4JData(m_dataTag);
for (AUTO_VAR(it, m_enchantments.begin()); it != m_enchantments.end(); for (auto it = m_enchantments.begin(); it != m_enchantments.end();
++it) { ++it) {
(*it)->enchantItem(newItem); (*it)->enchantItem(newItem);
} }

View file

@ -28,7 +28,7 @@ bool CompleteAllRuleDefinition::onCollectItem(
void CompleteAllRuleDefinition::updateStatus(GameRule* rule) { void CompleteAllRuleDefinition::updateStatus(GameRule* rule) {
int goal = 0; int goal = 0;
int progress = 0; int progress = 0;
for (AUTO_VAR(it, rule->m_parameters.begin()); for (auto it = rule->m_parameters.begin();
it != rule->m_parameters.end(); ++it) { it != rule->m_parameters.end(); ++it) {
if (it->second.isPointer) { if (it->second.isPointer) {
goal += it->second.gr->getGameRuleDefinition()->getGoal(); goal += it->second.gr->getGameRuleDefinition()->getGoal();

View file

@ -9,7 +9,7 @@ CompoundGameRuleDefinition::CompoundGameRuleDefinition() {
} }
CompoundGameRuleDefinition::~CompoundGameRuleDefinition() { CompoundGameRuleDefinition::~CompoundGameRuleDefinition() {
for (AUTO_VAR(it, m_children.begin()); it != m_children.end(); ++it) { for (auto it = m_children.begin(); it != m_children.end(); ++it) {
delete (*it); delete (*it);
} }
} }
@ -17,7 +17,7 @@ CompoundGameRuleDefinition::~CompoundGameRuleDefinition() {
void CompoundGameRuleDefinition::getChildren( void CompoundGameRuleDefinition::getChildren(
std::vector<GameRuleDefinition*>* children) { std::vector<GameRuleDefinition*>* children) {
GameRuleDefinition::getChildren(children); GameRuleDefinition::getChildren(children);
for (AUTO_VAR(it, m_children.begin()); it != m_children.end(); it++) for (auto it = m_children.begin(); it != m_children.end(); it++)
children->push_back(*it); children->push_back(*it);
} }
@ -48,7 +48,7 @@ void CompoundGameRuleDefinition::populateGameRule(
GameRulesInstance::EGameRulesInstanceType type, GameRule* rule) { GameRulesInstance::EGameRulesInstanceType type, GameRule* rule) {
GameRule* newRule = NULL; GameRule* newRule = NULL;
int i = 0; int i = 0;
for (AUTO_VAR(it, m_children.begin()); it != m_children.end(); ++it) { for (auto it = m_children.begin(); it != m_children.end(); ++it) {
newRule = new GameRule(*it, rule->getConnection()); newRule = new GameRule(*it, rule->getConnection());
(*it)->populateGameRule(type, newRule); (*it)->populateGameRule(type, newRule);
@ -66,7 +66,7 @@ void CompoundGameRuleDefinition::populateGameRule(
bool CompoundGameRuleDefinition::onUseTile(GameRule* rule, int tileId, int x, bool CompoundGameRuleDefinition::onUseTile(GameRule* rule, int tileId, int x,
int y, int z) { int y, int z) {
bool statusChanged = false; bool statusChanged = false;
for (AUTO_VAR(it, rule->m_parameters.begin()); for (auto it = rule->m_parameters.begin();
it != rule->m_parameters.end(); ++it) { it != rule->m_parameters.end(); ++it) {
if (it->second.isPointer) { if (it->second.isPointer) {
bool changed = it->second.gr->getGameRuleDefinition()->onUseTile( bool changed = it->second.gr->getGameRuleDefinition()->onUseTile(
@ -84,7 +84,7 @@ bool CompoundGameRuleDefinition::onUseTile(GameRule* rule, int tileId, int x,
bool CompoundGameRuleDefinition::onCollectItem( bool CompoundGameRuleDefinition::onCollectItem(
GameRule* rule, std::shared_ptr<ItemInstance> item) { GameRule* rule, std::shared_ptr<ItemInstance> item) {
bool statusChanged = false; bool statusChanged = false;
for (AUTO_VAR(it, rule->m_parameters.begin()); for (auto it = rule->m_parameters.begin();
it != rule->m_parameters.end(); ++it) { it != rule->m_parameters.end(); ++it) {
if (it->second.isPointer) { if (it->second.isPointer) {
bool changed = bool changed =
@ -102,7 +102,7 @@ bool CompoundGameRuleDefinition::onCollectItem(
void CompoundGameRuleDefinition::postProcessPlayer( void CompoundGameRuleDefinition::postProcessPlayer(
std::shared_ptr<Player> player) { std::shared_ptr<Player> player) {
for (AUTO_VAR(it, m_children.begin()); it != m_children.end(); ++it) { for (auto it = m_children.begin(); it != m_children.end(); ++it) {
(*it)->postProcessPlayer(player); (*it)->postProcessPlayer(player);
} }
} }

View file

@ -18,7 +18,7 @@ void ConsoleGenerateStructure::getChildren(
std::vector<GameRuleDefinition*>* children) { std::vector<GameRuleDefinition*>* children) {
GameRuleDefinition::getChildren(children); GameRuleDefinition::getChildren(children);
for (AUTO_VAR(it, m_actions.begin()); it != m_actions.end(); it++) for (auto it = m_actions.begin(); it != m_actions.end(); it++)
children->push_back(*it); children->push_back(*it);
} }
@ -104,7 +104,7 @@ BoundingBox* ConsoleGenerateStructure::getBoundingBox() {
// Find the max bounds // Find the max bounds
int maxX, maxY, maxZ; int maxX, maxY, maxZ;
maxX = maxY = maxZ = 1; maxX = maxY = maxZ = 1;
for (AUTO_VAR(it, m_actions.begin()); it != m_actions.end(); ++it) { for (auto it = m_actions.begin(); it != m_actions.end(); ++it) {
ConsoleGenerateStructureAction* action = *it; ConsoleGenerateStructureAction* action = *it;
maxX = std::max(maxX, action->getEndX()); maxX = std::max(maxX, action->getEndX());
maxY = std::max(maxY, action->getEndY()); maxY = std::max(maxY, action->getEndY());
@ -121,7 +121,7 @@ bool ConsoleGenerateStructure::postProcess(Level* level, Random* random,
BoundingBox* chunkBB) { BoundingBox* chunkBB) {
if (level->dimension->id != m_dimension) return false; if (level->dimension->id != m_dimension) return false;
for (AUTO_VAR(it, m_actions.begin()); it != m_actions.end(); ++it) { for (auto it = m_actions.begin(); it != m_actions.end(); ++it) {
ConsoleGenerateStructureAction* action = *it; ConsoleGenerateStructureAction* action = *it;
switch (action->getActionType()) { switch (action->getActionType()) {

View file

@ -169,7 +169,7 @@ void ConsoleSchematicFile::save_tags(DataOutputStream* dos) {
ListTag<CompoundTag>* tileEntityTags = new ListTag<CompoundTag>(); ListTag<CompoundTag>* tileEntityTags = new ListTag<CompoundTag>();
tag->put(L"TileEntities", tileEntityTags); tag->put(L"TileEntities", tileEntityTags);
for (AUTO_VAR(it, m_tileEntities.begin()); it != m_tileEntities.end(); for (auto it = m_tileEntities.begin(); it != m_tileEntities.end();
it++) { it++) {
CompoundTag* cTag = new CompoundTag(); CompoundTag* cTag = new CompoundTag();
(*it)->save(cTag); (*it)->save(cTag);
@ -179,7 +179,7 @@ void ConsoleSchematicFile::save_tags(DataOutputStream* dos) {
ListTag<CompoundTag>* entityTags = new ListTag<CompoundTag>(); ListTag<CompoundTag>* entityTags = new ListTag<CompoundTag>();
tag->put(L"Entities", entityTags); tag->put(L"Entities", entityTags);
for (AUTO_VAR(it, m_entities.begin()); it != m_entities.end(); it++) for (auto it = m_entities.begin(); it != m_entities.end(); it++)
entityTags->add((CompoundTag*)(*it).second->copy()); entityTags->add((CompoundTag*)(*it).second->copy());
NbtIo::write(tag, dos); NbtIo::write(tag, dos);
@ -452,7 +452,7 @@ void ConsoleSchematicFile::schematicCoordToChunkCoord(
void ConsoleSchematicFile::applyTileEntities(LevelChunk* chunk, AABB* chunkBox, void ConsoleSchematicFile::applyTileEntities(LevelChunk* chunk, AABB* chunkBox,
AABB* destinationBox, AABB* destinationBox,
ESchematicRotation rot) { ESchematicRotation rot) {
for (AUTO_VAR(it, m_tileEntities.begin()); it != m_tileEntities.end(); for (auto it = m_tileEntities.begin(); it != m_tileEntities.end();
++it) { ++it) {
std::shared_ptr<TileEntity> te = *it; std::shared_ptr<TileEntity> te = *it;
@ -499,7 +499,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk* chunk, AABB* chunkBox,
teCopy->setChanged(); teCopy->setChanged();
} }
} }
for (AUTO_VAR(it, m_entities.begin()); it != m_entities.end();) { for (auto it = m_entities.begin(); it != m_entities.end();) {
Vec3 source = it->first; Vec3 source = it->first;
double targetX = source.x; double targetX = source.x;
@ -714,7 +714,7 @@ void ConsoleSchematicFile::generateSchematicFile(
getTileEntitiesInRegion(level->getChunk(xc, zc), xStart, yStart, getTileEntitiesInRegion(level->getChunk(xc, zc), xStart, yStart,
zStart, xStart + xSize, yStart + ySize, zStart, xStart + xSize, yStart + ySize,
zStart + zSize); zStart + zSize);
for (AUTO_VAR(it, tileEntities->begin()); it != tileEntities->end(); for (auto it = tileEntities->begin(); it != tileEntities->end();
++it) { ++it) {
std::shared_ptr<TileEntity> te = *it; std::shared_ptr<TileEntity> te = *it;
CompoundTag* teTag = new CompoundTag(); CompoundTag* teTag = new CompoundTag();
@ -738,7 +738,7 @@ void ConsoleSchematicFile::generateSchematicFile(
level->getEntities(nullptr, &bb); level->getEntities(nullptr, &bb);
ListTag<CompoundTag>* entitiesTag = new ListTag<CompoundTag>(L"entities"); ListTag<CompoundTag>* entitiesTag = new ListTag<CompoundTag>(L"entities");
for (AUTO_VAR(it, entities->begin()); it != entities->end(); ++it) { for (auto it = entities->begin(); it != entities->end(); ++it) {
std::shared_ptr<Entity> e = *it; std::shared_ptr<Entity> e = *it;
bool mobCanBeSaved = false; bool mobCanBeSaved = false;
@ -1070,7 +1070,7 @@ ConsoleSchematicFile::getTileEntitiesInRegion(LevelChunk* chunk, int x0, int y0,
int z0, int x1, int y1, int z1) { int z0, int x1, int y1, int z1) {
std::vector<std::shared_ptr<TileEntity> >* result = std::vector<std::shared_ptr<TileEntity> >* result =
new std::vector<std::shared_ptr<TileEntity> >; new std::vector<std::shared_ptr<TileEntity> >;
for (AUTO_VAR(it, chunk->tileEntities.begin()); for (auto it = chunk->tileEntities.begin();
it != chunk->tileEntities.end(); ++it) { it != chunk->tileEntities.end(); ++it) {
std::shared_ptr<TileEntity> te = it->second; std::shared_ptr<TileEntity> te = it->second;
if (te->x >= x0 && te->y >= y0 && te->z >= z0 && te->x < x1 && if (te->x >= x0 && te->y >= y0 && te->z >= z0 && te->x < x1 &&

View file

@ -7,7 +7,7 @@ GameRule::GameRule(GameRuleDefinition* definition, Connection* connection) {
} }
GameRule::~GameRule() { GameRule::~GameRule() {
for (AUTO_VAR(it, m_parameters.begin()); it != m_parameters.end(); ++it) { for (auto it = m_parameters.begin(); it != m_parameters.end(); ++it) {
if (it->second.isPointer) { if (it->second.isPointer) {
delete it->second.gr; delete it->second.gr;
} }
@ -51,7 +51,7 @@ void GameRule::onCollectItem(std::shared_ptr<ItemInstance> item) {
void GameRule::write(DataOutputStream* dos) { void GameRule::write(DataOutputStream* dos) {
// Find required parameters. // Find required parameters.
dos->writeInt(m_parameters.size()); dos->writeInt(m_parameters.size());
for (AUTO_VAR(it, m_parameters.begin()); it != m_parameters.end(); it++) { for (auto it = m_parameters.begin(); it != m_parameters.end(); it++) {
std::wstring pName = (*it).first; std::wstring pName = (*it).first;
ValueType vType = (*it).second; ValueType vType = (*it).second;

View file

@ -24,7 +24,7 @@ void GameRuleDefinition::write(DataOutputStream* dos) {
// Write children. // Write children.
dos->writeInt(children->size()); dos->writeInt(children->size());
for (AUTO_VAR(it, children->begin()); it != children->end(); it++) for (auto it = children->begin(); it != children->end(); it++)
(*it)->write(dos); (*it)->write(dos);
} }
@ -119,7 +119,7 @@ GameRuleDefinition::enumerateMap() {
int i = 0; int i = 0;
std::vector<GameRuleDefinition*>* gRules = enumerate(); std::vector<GameRuleDefinition*>* gRules = enumerate();
for (AUTO_VAR(it, gRules->begin()); it != gRules->end(); it++) for (auto it = gRules->begin(); it != gRules->end(); it++)
out->insert(std::pair<GameRuleDefinition*, int>(*it, i++)); out->insert(std::pair<GameRuleDefinition*, int>(*it, i++));
return out; return out;

View file

@ -348,7 +348,7 @@ void GameRuleManager::writeRuleFile(DataOutputStream* dos) {
std::unordered_map<std::wstring, ConsoleSchematicFile*>* files; std::unordered_map<std::wstring, ConsoleSchematicFile*>* files;
files = getLevelGenerationOptions()->getUnfinishedSchematicFiles(); files = getLevelGenerationOptions()->getUnfinishedSchematicFiles();
dos->writeInt(files->size()); dos->writeInt(files->size());
for (AUTO_VAR(it, files->begin()); it != files->end(); it++) { for (auto it = files->begin(); it != files->end(); it++) {
std::wstring filename = it->first; std::wstring filename = it->first;
ConsoleSchematicFile* file = it->second; ConsoleSchematicFile* file = it->second;
@ -528,7 +528,7 @@ bool GameRuleManager::readRuleFile(
int tagId = contentDis->readInt(); int tagId = contentDis->readInt();
ConsoleGameRules::EGameRuleType tagVal = ConsoleGameRules::EGameRuleType tagVal =
ConsoleGameRules::eGameRuleType_Invalid; ConsoleGameRules::eGameRuleType_Invalid;
AUTO_VAR(it, tagIdMap.find(tagId)); auto it = tagIdMap.find(tagId);
if (it != tagIdMap.end()) tagVal = it->second; if (it != tagIdMap.end()) tagVal = it->second;
GameRuleDefinition* rule = NULL; GameRuleDefinition* rule = NULL;
@ -601,7 +601,7 @@ void GameRuleManager::readChildren(
int tagId = dis->readInt(); int tagId = dis->readInt();
ConsoleGameRules::EGameRuleType tagVal = ConsoleGameRules::EGameRuleType tagVal =
ConsoleGameRules::eGameRuleType_Invalid; ConsoleGameRules::eGameRuleType_Invalid;
AUTO_VAR(it, tagIdMap->find(tagId)); auto it = tagIdMap->find(tagId);
if (it != tagIdMap->end()) tagVal = it->second; if (it != tagIdMap->end()) tagVal = it->second;
GameRuleDefinition* childRule = NULL; GameRuleDefinition* childRule = NULL;

View file

@ -74,21 +74,21 @@ LevelGenerationOptions::LevelGenerationOptions(DLCPack* parentPack) {
LevelGenerationOptions::~LevelGenerationOptions() { LevelGenerationOptions::~LevelGenerationOptions() {
clearSchematics(); clearSchematics();
if (m_spawnPos != NULL) delete m_spawnPos; if (m_spawnPos != NULL) delete m_spawnPos;
for (AUTO_VAR(it, m_schematicRules.begin()); it != m_schematicRules.end(); for (auto it = m_schematicRules.begin(); it != m_schematicRules.end();
++it) { ++it) {
delete *it; delete *it;
} }
for (AUTO_VAR(it, m_structureRules.begin()); it != m_structureRules.end(); for (auto it = m_structureRules.begin(); it != m_structureRules.end();
++it) { ++it) {
delete *it; delete *it;
} }
for (AUTO_VAR(it, m_biomeOverrides.begin()); it != m_biomeOverrides.end(); for (auto it = m_biomeOverrides.begin(); it != m_biomeOverrides.end();
++it) { ++it) {
delete *it; delete *it;
} }
for (AUTO_VAR(it, m_features.begin()); it != m_features.end(); ++it) { for (auto it = m_features.begin(); it != m_features.end(); ++it) {
delete *it; delete *it;
} }
@ -124,20 +124,20 @@ void LevelGenerationOptions::getChildren(
GameRuleDefinition::getChildren(children); GameRuleDefinition::getChildren(children);
std::vector<ApplySchematicRuleDefinition*> used_schematics; std::vector<ApplySchematicRuleDefinition*> used_schematics;
for (AUTO_VAR(it, m_schematicRules.begin()); it != m_schematicRules.end(); for (auto it = m_schematicRules.begin(); it != m_schematicRules.end();
it++) it++)
if (!(*it)->isComplete()) used_schematics.push_back(*it); if (!(*it)->isComplete()) used_schematics.push_back(*it);
for (AUTO_VAR(it, m_structureRules.begin()); it != m_structureRules.end(); for (auto it = m_structureRules.begin(); it != m_structureRules.end();
it++) it++)
children->push_back(*it); children->push_back(*it);
for (AUTO_VAR(it, used_schematics.begin()); it != used_schematics.end(); for (auto it = used_schematics.begin(); it != used_schematics.end();
it++) it++)
children->push_back(*it); children->push_back(*it);
for (AUTO_VAR(it, m_biomeOverrides.begin()); it != m_biomeOverrides.end(); for (auto it = m_biomeOverrides.begin(); it != m_biomeOverrides.end();
++it) ++it)
children->push_back(*it); children->push_back(*it);
for (AUTO_VAR(it, m_features.begin()); it != m_features.end(); ++it) for (auto it = m_features.begin(); it != m_features.end(); ++it)
children->push_back(*it); children->push_back(*it);
} }
@ -255,7 +255,7 @@ void LevelGenerationOptions::processSchematics(LevelChunk* chunk) {
chunk->z); chunk->z);
AABB chunkBox(chunk->x * 16, 0, chunk->z * 16, chunk->x * 16 + 16, AABB chunkBox(chunk->x * 16, 0, chunk->z * 16, chunk->x * 16 + 16,
Level::maxBuildHeight, chunk->z * 16 + 16); Level::maxBuildHeight, chunk->z * 16 + 16);
for (AUTO_VAR(it, m_schematicRules.begin()); it != m_schematicRules.end(); for (auto it = m_schematicRules.begin(); it != m_schematicRules.end();
++it) { ++it) {
ApplySchematicRuleDefinition* rule = *it; ApplySchematicRuleDefinition* rule = *it;
rule->processSchematic(&chunkBox, chunk); rule->processSchematic(&chunkBox, chunk);
@ -264,7 +264,7 @@ void LevelGenerationOptions::processSchematics(LevelChunk* chunk) {
int cx = (chunk->x << 4); int cx = (chunk->x << 4);
int cz = (chunk->z << 4); int cz = (chunk->z << 4);
for (AUTO_VAR(it, m_structureRules.begin()); it != m_structureRules.end(); for (auto it = m_structureRules.begin(); it != m_structureRules.end();
it++) { it++) {
ConsoleGenerateStructure* structureStart = *it; ConsoleGenerateStructure* structureStart = *it;
@ -283,7 +283,7 @@ void LevelGenerationOptions::processSchematicsLighting(LevelChunk* chunk) {
chunk->x, chunk->z); chunk->x, chunk->z);
AABB chunkBox(chunk->x * 16, 0, chunk->z * 16, chunk->x * 16 + 16, AABB chunkBox(chunk->x * 16, 0, chunk->z * 16, chunk->x * 16 + 16,
Level::maxBuildHeight, chunk->z * 16 + 16); Level::maxBuildHeight, chunk->z * 16 + 16);
for (AUTO_VAR(it, m_schematicRules.begin()); it != m_schematicRules.end(); for (auto it = m_schematicRules.begin(); it != m_schematicRules.end();
++it) { ++it) {
ApplySchematicRuleDefinition* rule = *it; ApplySchematicRuleDefinition* rule = *it;
rule->processSchematicLighting(&chunkBox, chunk); rule->processSchematicLighting(&chunkBox, chunk);
@ -300,14 +300,14 @@ bool LevelGenerationOptions::checkIntersects(int x0, int y0, int z0, int x1,
// ground/sea level and b) tutorial world additions generally being above // ground/sea level and b) tutorial world additions generally being above
// ground/sea level // ground/sea level
if (!m_bHaveMinY) { if (!m_bHaveMinY) {
for (AUTO_VAR(it, m_schematicRules.begin()); for (auto it = m_schematicRules.begin();
it != m_schematicRules.end(); ++it) { it != m_schematicRules.end(); ++it) {
ApplySchematicRuleDefinition* rule = *it; ApplySchematicRuleDefinition* rule = *it;
int minY = rule->getMinY(); int minY = rule->getMinY();
if (minY < m_minY) m_minY = minY; if (minY < m_minY) m_minY = minY;
} }
for (AUTO_VAR(it, m_structureRules.begin()); for (auto it = m_structureRules.begin();
it != m_structureRules.end(); it++) { it != m_structureRules.end(); it++) {
ConsoleGenerateStructure* structureStart = *it; ConsoleGenerateStructure* structureStart = *it;
int minY = structureStart->getMinY(); int minY = structureStart->getMinY();
@ -322,7 +322,7 @@ bool LevelGenerationOptions::checkIntersects(int x0, int y0, int z0, int x1,
if (y1 < m_minY) return false; if (y1 < m_minY) return false;
bool intersects = false; bool intersects = false;
for (AUTO_VAR(it, m_schematicRules.begin()); it != m_schematicRules.end(); for (auto it = m_schematicRules.begin(); it != m_schematicRules.end();
++it) { ++it) {
ApplySchematicRuleDefinition* rule = *it; ApplySchematicRuleDefinition* rule = *it;
intersects = rule->checkIntersects(x0, y0, z0, x1, y1, z1); intersects = rule->checkIntersects(x0, y0, z0, x1, y1, z1);
@ -330,7 +330,7 @@ bool LevelGenerationOptions::checkIntersects(int x0, int y0, int z0, int x1,
} }
if (!intersects) { if (!intersects) {
for (AUTO_VAR(it, m_structureRules.begin()); for (auto it = m_structureRules.begin();
it != m_structureRules.end(); it++) { it != m_structureRules.end(); it++) {
ConsoleGenerateStructure* structureStart = *it; ConsoleGenerateStructure* structureStart = *it;
intersects = intersects =
@ -343,7 +343,7 @@ bool LevelGenerationOptions::checkIntersects(int x0, int y0, int z0, int x1,
} }
void LevelGenerationOptions::clearSchematics() { void LevelGenerationOptions::clearSchematics() {
for (AUTO_VAR(it, m_schematics.begin()); it != m_schematics.end(); ++it) { for (auto it = m_schematics.begin(); it != m_schematics.end(); ++it) {
delete it->second; delete it->second;
} }
m_schematics.clear(); m_schematics.clear();
@ -353,7 +353,7 @@ ConsoleSchematicFile* LevelGenerationOptions::loadSchematicFile(
const std::wstring& filename, std::uint8_t* pbData, const std::wstring& filename, std::uint8_t* pbData,
unsigned int dataLength) { unsigned int dataLength) {
// If we have already loaded this, just return // If we have already loaded this, just return
AUTO_VAR(it, m_schematics.find(filename)); auto it = m_schematics.find(filename);
if (it != m_schematics.end()) { if (it != m_schematics.end()) {
#if !defined(_CONTENT_PACKAGE) #if !defined(_CONTENT_PACKAGE)
wprintf(L"We have already loaded schematic file %ls\n", wprintf(L"We have already loaded schematic file %ls\n",
@ -378,7 +378,7 @@ ConsoleSchematicFile* LevelGenerationOptions::getSchematicFile(
const std::wstring& filename) { const std::wstring& filename) {
ConsoleSchematicFile* schematic = NULL; ConsoleSchematicFile* schematic = NULL;
// If we have already loaded this, just return // If we have already loaded this, just return
AUTO_VAR(it, m_schematics.find(filename)); auto it = m_schematics.find(filename);
if (it != m_schematics.end()) { if (it != m_schematics.end()) {
schematic = it->second; schematic = it->second;
} }
@ -389,7 +389,7 @@ void LevelGenerationOptions::releaseSchematicFile(
const std::wstring& filename) { const std::wstring& filename) {
// 4J Stu - We don't want to delete them when done, but probably want to // 4J Stu - We don't want to delete them when done, but probably want to
// keep a set of active schematics for the current world // keep a set of active schematics for the current world
// AUTO_VAR(it, m_schematics.find(filename)); // auto it = m_schematics.find(filename);
// if(it != m_schematics.end()) // if(it != m_schematics.end())
//{ //{
// ConsoleSchematicFile *schematic = it->second; // ConsoleSchematicFile *schematic = it->second;
@ -416,7 +416,7 @@ const wchar_t* LevelGenerationOptions::getString(const std::wstring& key) {
void LevelGenerationOptions::getBiomeOverride(int biomeId, std::uint8_t& tile, void LevelGenerationOptions::getBiomeOverride(int biomeId, std::uint8_t& tile,
std::uint8_t& topTile) { std::uint8_t& topTile) {
for (AUTO_VAR(it, m_biomeOverrides.begin()); it != m_biomeOverrides.end(); for (auto it = m_biomeOverrides.begin(); it != m_biomeOverrides.end();
++it) { ++it) {
BiomeOverride* bo = *it; BiomeOverride* bo = *it;
if (bo->isBiome(biomeId)) { if (bo->isBiome(biomeId)) {
@ -431,7 +431,7 @@ bool LevelGenerationOptions::isFeatureChunk(
int* orientation) { int* orientation) {
bool isFeature = false; bool isFeature = false;
for (AUTO_VAR(it, m_features.begin()); it != m_features.end(); ++it) { for (auto it = m_features.begin(); it != m_features.end(); ++it) {
StartFeature* sf = *it; StartFeature* sf = *it;
if (sf->isFeatureChunk(chunkX, chunkZ, feature, orientation)) { if (sf->isFeatureChunk(chunkX, chunkZ, feature, orientation)) {
isFeature = true; isFeature = true;
@ -446,14 +446,14 @@ LevelGenerationOptions::getUnfinishedSchematicFiles() {
// Clean schematic rules. // Clean schematic rules.
std::unordered_set<std::wstring> usedFiles = std::unordered_set<std::wstring> usedFiles =
std::unordered_set<std::wstring>(); std::unordered_set<std::wstring>();
for (AUTO_VAR(it, m_schematicRules.begin()); it != m_schematicRules.end(); for (auto it = m_schematicRules.begin(); it != m_schematicRules.end();
it++) it++)
if (!(*it)->isComplete()) usedFiles.insert((*it)->getSchematicName()); if (!(*it)->isComplete()) usedFiles.insert((*it)->getSchematicName());
// Clean schematic files. // Clean schematic files.
std::unordered_map<std::wstring, ConsoleSchematicFile*>* out = std::unordered_map<std::wstring, ConsoleSchematicFile*>* out =
new std::unordered_map<std::wstring, ConsoleSchematicFile*>(); new std::unordered_map<std::wstring, ConsoleSchematicFile*>();
for (AUTO_VAR(it, usedFiles.begin()); it != usedFiles.end(); it++) for (auto it = usedFiles.begin(); it != usedFiles.end(); it++)
out->insert(std::pair<std::wstring, ConsoleSchematicFile*>( out->insert(std::pair<std::wstring, ConsoleSchematicFile*>(
*it, getSchematicFile(*it))); *it, getSchematicFile(*it)));
@ -624,7 +624,7 @@ int LevelGenerationOptions::packMounted(LPVOID pParam, int iPad, DWORD dwErr,
} }
void LevelGenerationOptions::reset_start() { void LevelGenerationOptions::reset_start() {
for (AUTO_VAR(it, m_schematicRules.begin()); it != m_schematicRules.end(); for (auto it = m_schematicRules.begin(); it != m_schematicRules.end();
it++) { it++) {
(*it)->reset(); (*it)->reset();
} }

View file

@ -7,14 +7,14 @@
LevelRuleset::LevelRuleset() { m_stringTable = NULL; } LevelRuleset::LevelRuleset() { m_stringTable = NULL; }
LevelRuleset::~LevelRuleset() { LevelRuleset::~LevelRuleset() {
for (AUTO_VAR(it, m_areas.begin()); it != m_areas.end(); ++it) { for (auto it = m_areas.begin(); it != m_areas.end(); ++it) {
delete *it; delete *it;
} }
} }
void LevelRuleset::getChildren(std::vector<GameRuleDefinition*>* children) { void LevelRuleset::getChildren(std::vector<GameRuleDefinition*>* children) {
CompoundGameRuleDefinition::getChildren(children); CompoundGameRuleDefinition::getChildren(children);
for (AUTO_VAR(it, m_areas.begin()); it != m_areas.end(); it++) for (auto it = m_areas.begin(); it != m_areas.end(); it++)
children->push_back(*it); children->push_back(*it);
} }
@ -44,7 +44,7 @@ const wchar_t* LevelRuleset::getString(const std::wstring& key) {
AABB* LevelRuleset::getNamedArea(const std::wstring& areaName) { AABB* LevelRuleset::getNamedArea(const std::wstring& areaName) {
AABB* area = NULL; AABB* area = NULL;
for (AUTO_VAR(it, m_areas.begin()); it != m_areas.end(); ++it) { for (auto it = m_areas.begin(); it != m_areas.end(); ++it) {
if ((*it)->getName().compare(areaName) == 0) { if ((*it)->getName().compare(areaName) == 0) {
area = (*it)->getArea(); area = (*it)->getArea();
break; break;

View file

@ -17,7 +17,7 @@ UpdatePlayerRuleDefinition::UpdatePlayerRuleDefinition() {
} }
UpdatePlayerRuleDefinition::~UpdatePlayerRuleDefinition() { UpdatePlayerRuleDefinition::~UpdatePlayerRuleDefinition() {
for (AUTO_VAR(it, m_items.begin()); it != m_items.end(); ++it) { for (auto it = m_items.begin(); it != m_items.end(); ++it) {
delete *it; delete *it;
} }
} }
@ -54,7 +54,7 @@ void UpdatePlayerRuleDefinition::writeAttributes(DataOutputStream* dos,
void UpdatePlayerRuleDefinition::getChildren( void UpdatePlayerRuleDefinition::getChildren(
std::vector<GameRuleDefinition*>* children) { std::vector<GameRuleDefinition*>* children) {
GameRuleDefinition::getChildren(children); GameRuleDefinition::getChildren(children);
for (AUTO_VAR(it, m_items.begin()); it != m_items.end(); it++) for (auto it = m_items.begin(); it != m_items.end(); it++)
children->push_back(*it); children->push_back(*it);
} }
@ -147,7 +147,7 @@ void UpdatePlayerRuleDefinition::postProcessPlayer(
if (m_spawnPos != NULL || m_bUpdateYRot) if (m_spawnPos != NULL || m_bUpdateYRot)
player->absMoveTo(x, y, z, yRot, xRot); player->absMoveTo(x, y, z, yRot, xRot);
for (AUTO_VAR(it, m_items.begin()); it != m_items.end(); ++it) { for (auto it = m_items.begin(); it != m_items.end(); ++it) {
AddItemRuleDefinition* addItem = *it; AddItemRuleDefinition* addItem = *it;
addItem->addItemToContainer(player->inventory, -1); addItem->addItemToContainer(player->inventory, -1);

View file

@ -12,7 +12,7 @@ XboxStructureActionPlaceContainer::XboxStructureActionPlaceContainer() {
} }
XboxStructureActionPlaceContainer::~XboxStructureActionPlaceContainer() { XboxStructureActionPlaceContainer::~XboxStructureActionPlaceContainer() {
for (AUTO_VAR(it, m_items.begin()); it != m_items.end(); ++it) { for (auto it = m_items.begin(); it != m_items.end(); ++it) {
delete *it; delete *it;
} }
} }
@ -24,7 +24,7 @@ XboxStructureActionPlaceContainer::~XboxStructureActionPlaceContainer() {
void XboxStructureActionPlaceContainer::getChildren( void XboxStructureActionPlaceContainer::getChildren(
std::vector<GameRuleDefinition*>* children) { std::vector<GameRuleDefinition*>* children) {
XboxStructureActionPlaceBlock::getChildren(children); XboxStructureActionPlaceBlock::getChildren(children);
for (AUTO_VAR(it, m_items.begin()); it != m_items.end(); it++) for (auto it = m_items.begin(); it != m_items.end(); it++)
children->push_back(*it); children->push_back(*it);
} }
@ -88,7 +88,7 @@ bool XboxStructureActionPlaceContainer::placeContainerInLevel(
Tile::UPDATE_CLIENTS); Tile::UPDATE_CLIENTS);
// Add items // Add items
int slotId = 0; int slotId = 0;
for (AUTO_VAR(it, m_items.begin()); for (auto it = m_items.begin();
it != m_items.end() && it != m_items.end() &&
(slotId < container->getContainerSize()); (slotId < container->getContainerSize());
++it, ++slotId) { ++it, ++slotId) {

View file

@ -444,7 +444,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft* minecraft,
do { do {
// We need to keep ticking the connections for players that // We need to keep ticking the connections for players that
// already logged in // already logged in
for (AUTO_VAR(it, createdConnections.begin()); for (auto it = createdConnections.begin();
it < createdConnections.end(); ++it) { it < createdConnections.end(); ++it) {
(*it)->tick(); (*it)->tick();
} }
@ -482,8 +482,8 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft* minecraft,
idx, CONTEXT_PRESENCE_MULTIPLAYER, false); idx, CONTEXT_PRESENCE_MULTIPLAYER, false);
} else { } else {
connection->close(); connection->close();
AUTO_VAR(it, find(createdConnections.begin(), auto it = find(createdConnections.begin(),
createdConnections.end(), connection)); createdConnections.end(), connection);
if (it != createdConnections.end()) if (it != createdConnections.end())
createdConnections.erase(it); createdConnections.erase(it);
} }
@ -497,7 +497,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft* minecraft,
} }
if (g_NetworkManager.IsLeavingGame() || !IsInSession()) { if (g_NetworkManager.IsLeavingGame() || !IsInSession()) {
for (AUTO_VAR(it, createdConnections.begin()); for (auto it = createdConnections.begin();
it < createdConnections.end(); ++it) { it < createdConnections.end(); ++it) {
(*it)->close(); (*it)->close();
} }
@ -940,7 +940,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc(void* lpParam) {
// them being removed from the server when removed from the session // them being removed from the server when removed from the session
if (pServer != NULL) { if (pServer != NULL) {
PlayerList* players = pServer->getPlayers(); PlayerList* players = pServer->getPlayers();
for (AUTO_VAR(it, players->players.begin()); for (auto it = players->players.begin();
it < players->players.end(); ++it) { it < players->players.end(); ++it) {
std::shared_ptr<ServerPlayer> servPlayer = *it; std::shared_ptr<ServerPlayer> servPlayer = *it;
if (servPlayer->connection->isLocal() && if (servPlayer->connection->isLocal() &&
@ -1005,7 +1005,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc(void* lpParam) {
pMinecraft->localplayers[index]->getXuid(); pMinecraft->localplayers[index]->getXuid();
PlayerList* players = pServer->getPlayers(); PlayerList* players = pServer->getPlayers();
for (AUTO_VAR(it, players->players.begin()); for (auto it = players->players.begin();
it < players->players.end(); ++it) { it < players->players.end(); ++it) {
std::shared_ptr<ServerPlayer> servPlayer = *it; std::shared_ptr<ServerPlayer> servPlayer = *it;
if (servPlayer->getXuid() == localPlayerXuid) { if (servPlayer->getXuid() == localPlayerXuid) {

View file

@ -50,7 +50,7 @@ void CPlatformNetworkManagerStub::NotifyPlayerJoined(IQNetPlayer* pQNetPlayer) {
if (m_pIQNet->IsHost() && !m_bHostChanged) { if (m_pIQNet->IsHost() && !m_bHostChanged) {
// Do we already have a primary player for this system? // Do we already have a primary player for this system?
bool systemHasPrimaryPlayer = false; bool systemHasPrimaryPlayer = false;
for (AUTO_VAR(it, m_machineQNetPrimaryPlayers.begin()); for (auto it = m_machineQNetPrimaryPlayers.begin();
it < m_machineQNetPrimaryPlayers.end(); ++it) { it < m_machineQNetPrimaryPlayers.end(); ++it) {
IQNetPlayer* pQNetPrimaryPlayer = *it; IQNetPlayer* pQNetPrimaryPlayer = *it;
if (pQNetPlayer->IsSameSystem(pQNetPrimaryPlayer)) { if (pQNetPlayer->IsSameSystem(pQNetPrimaryPlayer)) {
@ -512,7 +512,7 @@ INetworkPlayer* CPlatformNetworkManagerStub::addNetworkPlayer(
void CPlatformNetworkManagerStub::removeNetworkPlayer( void CPlatformNetworkManagerStub::removeNetworkPlayer(
IQNetPlayer* pQNetPlayer) { IQNetPlayer* pQNetPlayer) {
INetworkPlayer* pNetworkPlayer = getNetworkPlayer(pQNetPlayer); INetworkPlayer* pNetworkPlayer = getNetworkPlayer(pQNetPlayer);
for (AUTO_VAR(it, currentNetworkPlayers.begin()); for (auto it = currentNetworkPlayers.begin();
it != currentNetworkPlayers.end(); it++) { it != currentNetworkPlayers.end(); it++) {
if (*it == pNetworkPlayer) { if (*it == pNetworkPlayer) {
currentNetworkPlayers.erase(it); currentNetworkPlayers.erase(it);

View file

@ -21,7 +21,7 @@ bool AreaTask::isCompleted() {
switch (m_completionState) { switch (m_completionState) {
case eAreaTaskCompletion_CompleteOnConstraintsSatisfied: { case eAreaTaskCompletion_CompleteOnConstraintsSatisfied: {
bool allSatisfied = true; bool allSatisfied = true;
for (AUTO_VAR(it, constraints.begin()); it != constraints.end(); for (auto it = constraints.begin(); it != constraints.end();
++it) { ++it) {
TutorialConstraint* constraint = *it; TutorialConstraint* constraint = *it;
if (!constraint->isConstraintSatisfied(tutorial->getPad())) { if (!constraint->isConstraintSatisfied(tutorial->getPad())) {

View file

@ -45,7 +45,7 @@ bool InfoTask::isCompleted() {
// If a menu is displayed, then we use the handleUIInput to complete the // If a menu is displayed, then we use the handleUIInput to complete the
// task // task
bAllComplete = true; bAllComplete = true;
for (AUTO_VAR(it, completedMappings.begin()); for (auto it = completedMappings.begin();
it != completedMappings.end(); ++it) { it != completedMappings.end(); ++it) {
bool current = (*it).second; bool current = (*it).second;
if (!current) { if (!current) {
@ -56,7 +56,7 @@ bool InfoTask::isCompleted() {
} else { } else {
int iCurrent = 0; int iCurrent = 0;
for (AUTO_VAR(it, completedMappings.begin()); for (auto it = completedMappings.begin();
it != completedMappings.end(); ++it) { it != completedMappings.end(); ++it) {
bool current = (*it).second; bool current = (*it).second;
if (!current) { if (!current) {
@ -94,7 +94,7 @@ void InfoTask::setAsCurrentTask(bool active /*= true*/) {
void InfoTask::handleUIInput(int iAction) { void InfoTask::handleUIInput(int iAction) {
if (bHasBeenActivated) { if (bHasBeenActivated) {
for (AUTO_VAR(it, completedMappings.begin()); for (auto it = completedMappings.begin();
it != completedMappings.end(); ++it) { it != completedMappings.end(); ++it) {
if (iAction == (*it).first) { if (iAction == (*it).first) {
(*it).second = true; (*it).second = true;

View file

@ -2,7 +2,7 @@
#include "ProcedureCompoundTask.h" #include "ProcedureCompoundTask.h"
ProcedureCompoundTask::~ProcedureCompoundTask() { ProcedureCompoundTask::~ProcedureCompoundTask() {
for (AUTO_VAR(it, m_taskSequence.begin()); it < m_taskSequence.end(); for (auto it = m_taskSequence.begin(); it < m_taskSequence.end();
++it) { ++it) {
delete (*it); delete (*it);
} }
@ -19,8 +19,8 @@ int ProcedureCompoundTask::getDescriptionId() {
// Return the id of the first task not completed // Return the id of the first task not completed
int descriptionId = -1; int descriptionId = -1;
AUTO_VAR(itEnd, m_taskSequence.end()); auto itEnd = m_taskSequence.end();
for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) { for (auto it = m_taskSequence.begin(); it < itEnd; ++it) {
TutorialTask* task = *it; TutorialTask* task = *it;
if (!task->isCompleted()) { if (!task->isCompleted()) {
task->setAsCurrentTask(true); task->setAsCurrentTask(true);
@ -40,8 +40,8 @@ int ProcedureCompoundTask::getPromptId() {
// Return the id of the first task not completed // Return the id of the first task not completed
int promptId = -1; int promptId = -1;
AUTO_VAR(itEnd, m_taskSequence.end()); auto itEnd = m_taskSequence.end();
for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) { for (auto it = m_taskSequence.begin(); it < itEnd; ++it) {
TutorialTask* task = *it; TutorialTask* task = *it;
if (!task->isCompleted()) { if (!task->isCompleted()) {
promptId = task->getPromptId(); promptId = task->getPromptId();
@ -56,8 +56,8 @@ bool ProcedureCompoundTask::isCompleted() {
bool allCompleted = true; bool allCompleted = true;
bool isCurrentTask = true; bool isCurrentTask = true;
AUTO_VAR(itEnd, m_taskSequence.end()); auto itEnd = m_taskSequence.end();
for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) { for (auto it = m_taskSequence.begin(); it < itEnd; ++it) {
TutorialTask* task = *it; TutorialTask* task = *it;
if (allCompleted && isCurrentTask) { if (allCompleted && isCurrentTask) {
@ -80,7 +80,7 @@ bool ProcedureCompoundTask::isCompleted() {
if (allCompleted) { if (allCompleted) {
// Disable all constraints // Disable all constraints
itEnd = m_taskSequence.end(); itEnd = m_taskSequence.end();
for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) { for (auto it = m_taskSequence.begin(); it < itEnd; ++it) {
TutorialTask* task = *it; TutorialTask* task = *it;
task->enableConstraints(false); task->enableConstraints(false);
} }
@ -90,16 +90,16 @@ bool ProcedureCompoundTask::isCompleted() {
} }
void ProcedureCompoundTask::onCrafted(std::shared_ptr<ItemInstance> item) { void ProcedureCompoundTask::onCrafted(std::shared_ptr<ItemInstance> item) {
AUTO_VAR(itEnd, m_taskSequence.end()); auto itEnd = m_taskSequence.end();
for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) { for (auto it = m_taskSequence.begin(); it < itEnd; ++it) {
TutorialTask* task = *it; TutorialTask* task = *it;
task->onCrafted(item); task->onCrafted(item);
} }
} }
void ProcedureCompoundTask::handleUIInput(int iAction) { void ProcedureCompoundTask::handleUIInput(int iAction) {
AUTO_VAR(itEnd, m_taskSequence.end()); auto itEnd = m_taskSequence.end();
for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) { for (auto it = m_taskSequence.begin(); it < itEnd; ++it) {
TutorialTask* task = *it; TutorialTask* task = *it;
task->handleUIInput(iAction); task->handleUIInput(iAction);
} }
@ -107,8 +107,8 @@ void ProcedureCompoundTask::handleUIInput(int iAction) {
void ProcedureCompoundTask::setAsCurrentTask(bool active /*= true*/) { void ProcedureCompoundTask::setAsCurrentTask(bool active /*= true*/) {
bool allCompleted = true; bool allCompleted = true;
AUTO_VAR(itEnd, m_taskSequence.end()); auto itEnd = m_taskSequence.end();
for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) { for (auto it = m_taskSequence.begin(); it < itEnd; ++it) {
TutorialTask* task = *it; TutorialTask* task = *it;
if (allCompleted && !task->isCompleted()) { if (allCompleted && !task->isCompleted()) {
task->setAsCurrentTask(true); task->setAsCurrentTask(true);
@ -123,8 +123,8 @@ bool ProcedureCompoundTask::ShowMinimumTime() {
if (bIsCompleted) return false; if (bIsCompleted) return false;
bool showMinimumTime = false; bool showMinimumTime = false;
AUTO_VAR(itEnd, m_taskSequence.end()); auto itEnd = m_taskSequence.end();
for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) { for (auto it = m_taskSequence.begin(); it < itEnd; ++it) {
TutorialTask* task = *it; TutorialTask* task = *it;
if (!task->isCompleted()) { if (!task->isCompleted()) {
showMinimumTime = task->ShowMinimumTime(); showMinimumTime = task->ShowMinimumTime();
@ -138,8 +138,8 @@ bool ProcedureCompoundTask::hasBeenActivated() {
if (bIsCompleted) return true; if (bIsCompleted) return true;
bool hasBeenActivated = false; bool hasBeenActivated = false;
AUTO_VAR(itEnd, m_taskSequence.end()); auto itEnd = m_taskSequence.end();
for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) { for (auto it = m_taskSequence.begin(); it < itEnd; ++it) {
TutorialTask* task = *it; TutorialTask* task = *it;
if (!task->isCompleted()) { if (!task->isCompleted()) {
hasBeenActivated = task->hasBeenActivated(); hasBeenActivated = task->hasBeenActivated();
@ -150,8 +150,8 @@ bool ProcedureCompoundTask::hasBeenActivated() {
} }
void ProcedureCompoundTask::setShownForMinimumTime() { void ProcedureCompoundTask::setShownForMinimumTime() {
AUTO_VAR(itEnd, m_taskSequence.end()); auto itEnd = m_taskSequence.end();
for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) { for (auto it = m_taskSequence.begin(); it < itEnd; ++it) {
TutorialTask* task = *it; TutorialTask* task = *it;
if (!task->isCompleted()) { if (!task->isCompleted()) {
task->setShownForMinimumTime(); task->setShownForMinimumTime();
@ -164,8 +164,8 @@ bool ProcedureCompoundTask::AllowFade() {
if (bIsCompleted) return true; if (bIsCompleted) return true;
bool allowFade = true; bool allowFade = true;
AUTO_VAR(itEnd, m_taskSequence.end()); auto itEnd = m_taskSequence.end();
for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) { for (auto it = m_taskSequence.begin(); it < itEnd; ++it) {
TutorialTask* task = *it; TutorialTask* task = *it;
if (!task->isCompleted()) { if (!task->isCompleted()) {
allowFade = task->AllowFade(); allowFade = task->AllowFade();
@ -178,8 +178,8 @@ bool ProcedureCompoundTask::AllowFade() {
void ProcedureCompoundTask::useItemOn(Level* level, void ProcedureCompoundTask::useItemOn(Level* level,
std::shared_ptr<ItemInstance> item, int x, std::shared_ptr<ItemInstance> item, int x,
int y, int z, bool bTestUseOnly) { int y, int z, bool bTestUseOnly) {
AUTO_VAR(itEnd, m_taskSequence.end()); auto itEnd = m_taskSequence.end();
for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) { for (auto it = m_taskSequence.begin(); it < itEnd; ++it) {
TutorialTask* task = *it; TutorialTask* task = *it;
task->useItemOn(level, item, x, y, z, bTestUseOnly); task->useItemOn(level, item, x, y, z, bTestUseOnly);
} }
@ -187,8 +187,8 @@ void ProcedureCompoundTask::useItemOn(Level* level,
void ProcedureCompoundTask::useItem(std::shared_ptr<ItemInstance> item, void ProcedureCompoundTask::useItem(std::shared_ptr<ItemInstance> item,
bool bTestUseOnly) { bool bTestUseOnly) {
AUTO_VAR(itEnd, m_taskSequence.end()); auto itEnd = m_taskSequence.end();
for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) { for (auto it = m_taskSequence.begin(); it < itEnd; ++it) {
TutorialTask* task = *it; TutorialTask* task = *it;
task->useItem(item, bTestUseOnly); task->useItem(item, bTestUseOnly);
} }
@ -197,16 +197,16 @@ void ProcedureCompoundTask::useItem(std::shared_ptr<ItemInstance> item,
void ProcedureCompoundTask::onTake(std::shared_ptr<ItemInstance> item, void ProcedureCompoundTask::onTake(std::shared_ptr<ItemInstance> item,
unsigned int invItemCountAnyAux, unsigned int invItemCountAnyAux,
unsigned int invItemCountThisAux) { unsigned int invItemCountThisAux) {
AUTO_VAR(itEnd, m_taskSequence.end()); auto itEnd = m_taskSequence.end();
for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) { for (auto it = m_taskSequence.begin(); it < itEnd; ++it) {
TutorialTask* task = *it; TutorialTask* task = *it;
task->onTake(item, invItemCountAnyAux, invItemCountThisAux); task->onTake(item, invItemCountAnyAux, invItemCountThisAux);
} }
} }
void ProcedureCompoundTask::onStateChange(eTutorial_State newState) { void ProcedureCompoundTask::onStateChange(eTutorial_State newState) {
AUTO_VAR(itEnd, m_taskSequence.end()); auto itEnd = m_taskSequence.end();
for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) { for (auto it = m_taskSequence.begin(); it < itEnd; ++it) {
TutorialTask* task = *it; TutorialTask* task = *it;
task->onStateChange(newState); task->onStateChange(newState);
} }

View file

@ -1929,7 +1929,7 @@ Tutorial::Tutorial(int iPad, bool isFullTutorial /*= false*/) : m_iPad(iPad) {
} }
Tutorial::~Tutorial() { Tutorial::~Tutorial() {
for (AUTO_VAR(it, m_globalConstraints.begin()); for (auto it = m_globalConstraints.begin();
it != m_globalConstraints.end(); ++it) { it != m_globalConstraints.end(); ++it) {
delete (*it); delete (*it);
} }
@ -1939,11 +1939,11 @@ Tutorial::~Tutorial() {
delete (*it).second; delete (*it).second;
} }
for (unsigned int i = 0; i < e_Tutorial_State_Max; ++i) { for (unsigned int i = 0; i < e_Tutorial_State_Max; ++i) {
for (AUTO_VAR(it, activeTasks[i].begin()); it < activeTasks[i].end(); for (auto it = activeTasks[i].begin(); it < activeTasks[i].end();
++it) { ++it) {
delete (*it); delete (*it);
} }
for (AUTO_VAR(it, hints[i].begin()); it < hints[i].end(); ++it) { for (auto it = hints[i].begin(); it < hints[i].end(); ++it) {
delete (*it); delete (*it);
} }
@ -1968,7 +1968,7 @@ void Tutorial::setCompleted(int completableId) {
// } // }
int completableIndex = -1; int completableIndex = -1;
for (AUTO_VAR(it, s_completableTasks.begin()); for (auto it = s_completableTasks.begin();
it < s_completableTasks.end(); ++it) { it < s_completableTasks.end(); ++it) {
++completableIndex; ++completableIndex;
if (*it == completableId) { if (*it == completableId) {
@ -1996,7 +1996,7 @@ bool Tutorial::getCompleted(int completableId) {
// } // }
int completableIndex = -1; int completableIndex = -1;
for (AUTO_VAR(it, s_completableTasks.begin()); for (auto it = s_completableTasks.begin();
it < s_completableTasks.end(); ++it) { it < s_completableTasks.end(); ++it) {
++completableIndex; ++completableIndex;
if (*it == completableId) { if (*it == completableId) {
@ -2079,7 +2079,7 @@ void Tutorial::tick() {
bool taskChanged = false; bool taskChanged = false;
for (unsigned int state = 0; state < e_Tutorial_State_Max; ++state) { for (unsigned int state = 0; state < e_Tutorial_State_Max; ++state) {
AUTO_VAR(it, constraintsToRemove[state].begin()); auto it = constraintsToRemove[state].begin();
while (it < constraintsToRemove[state].end()) { while (it < constraintsToRemove[state].end()) {
++(*it).second; ++(*it).second;
if ((*it).second > m_iTutorialConstraintDelayRemoveTicks) { if ((*it).second > m_iTutorialConstraintDelayRemoveTicks) {
@ -2152,7 +2152,7 @@ void Tutorial::tick() {
} }
// Check constraints // Check constraints
for (AUTO_VAR(it, m_globalConstraints.begin()); for (auto it = m_globalConstraints.begin();
it < m_globalConstraints.end(); ++it) { it < m_globalConstraints.end(); ++it) {
TutorialConstraint* constraint = *it; TutorialConstraint* constraint = *it;
constraint->tick(m_iPad); constraint->tick(m_iPad);
@ -2167,7 +2167,7 @@ void Tutorial::tick() {
m_isFullTutorial || app.GetGameSettings(m_iPad, eGameSetting_Hints); m_isFullTutorial || app.GetGameSettings(m_iPad, eGameSetting_Hints);
if (hintsOn) { if (hintsOn) {
for (AUTO_VAR(it, hints[m_CurrentState].begin()); for (auto it = hints[m_CurrentState].begin();
it < hints[m_CurrentState].end(); ++it) { it < hints[m_CurrentState].end(); ++it) {
TutorialHint* hint = *it; TutorialHint* hint = *it;
hintNeeded = hint->tick(); hintNeeded = hint->tick();
@ -2195,7 +2195,7 @@ void Tutorial::tick() {
constraintChanged = true; constraintChanged = true;
currentFailedConstraint[m_CurrentState] = NULL; currentFailedConstraint[m_CurrentState] = NULL;
} }
for (AUTO_VAR(it, constraints[m_CurrentState].begin()); for (auto it = constraints[m_CurrentState].begin();
it < constraints[m_CurrentState].end(); ++it) { it < constraints[m_CurrentState].end(); ++it) {
TutorialConstraint* constraint = *it; TutorialConstraint* constraint = *it;
if (!constraint->isConstraintSatisfied(m_iPad) && if (!constraint->isConstraintSatisfied(m_iPad) &&
@ -2210,7 +2210,7 @@ void Tutorial::tick() {
currentFailedConstraint[m_CurrentState] == NULL) { currentFailedConstraint[m_CurrentState] == NULL) {
// Update tasks // Update tasks
bool isCurrentTask = true; bool isCurrentTask = true;
AUTO_VAR(it, activeTasks[m_CurrentState].begin()); auto it = activeTasks[m_CurrentState].begin();
while (activeTasks[m_CurrentState].size() > 0 && while (activeTasks[m_CurrentState].size() > 0 &&
it < activeTasks[m_CurrentState].end()) { it < activeTasks[m_CurrentState].end()) {
TutorialTask* task = *it; TutorialTask* task = *it;
@ -2233,9 +2233,9 @@ void Tutorial::tick() {
// 4J Stu - Move the delayed constraints to the // 4J Stu - Move the delayed constraints to the
// gameplay state so that they are in effect for // gameplay state so that they are in effect for
// a bit longer // a bit longer
AUTO_VAR(itCon, auto itCon =
constraintsToRemove[m_CurrentState] constraintsToRemove[m_CurrentState]
.begin()); .begin();
while ( while (
itCon != itCon !=
constraintsToRemove[m_CurrentState].end()) { constraintsToRemove[m_CurrentState].end()) {
@ -2259,9 +2259,9 @@ void Tutorial::tick() {
} }
// Fall through the the normal complete state // Fall through the the normal complete state
case e_Tutorial_Completion_Complete_State: case e_Tutorial_Completion_Complete_State:
for (AUTO_VAR( for (auto
itRem, itRem =
activeTasks[m_CurrentState].begin()); activeTasks[m_CurrentState].begin();
itRem < activeTasks[m_CurrentState].end(); itRem < activeTasks[m_CurrentState].end();
++itRem) { ++itRem) {
delete (*itRem); delete (*itRem);
@ -2273,9 +2273,9 @@ void Tutorial::tick() {
activeTasks[m_CurrentState].at( activeTasks[m_CurrentState].at(
activeTasks[m_CurrentState].size() - 1); activeTasks[m_CurrentState].size() - 1);
activeTasks[m_CurrentState].pop_back(); activeTasks[m_CurrentState].pop_back();
for (AUTO_VAR( for (auto
itRem, itRem =
activeTasks[m_CurrentState].begin()); activeTasks[m_CurrentState].begin();
itRem < activeTasks[m_CurrentState].end(); itRem < activeTasks[m_CurrentState].end();
++itRem) { ++itRem) {
delete (*itRem); delete (*itRem);
@ -2433,7 +2433,7 @@ bool Tutorial::setMessage(PopupMessageDetails* message) {
if (!message->m_messageString.empty()) { if (!message->m_messageString.empty()) {
text = message->m_messageString; text = message->m_messageString;
} else { } else {
AUTO_VAR(it, messages.find(message->m_messageId)); auto it = messages.find(message->m_messageId);
if (it != messages.end() && it->second != NULL) { if (it != messages.end() && it->second != NULL) {
TutorialMessage* messageString = it->second; TutorialMessage* messageString = it->second;
text = std::wstring(messageString->getMessageForDisplay()); text = std::wstring(messageString->getMessageForDisplay());
@ -2457,7 +2457,7 @@ bool Tutorial::setMessage(PopupMessageDetails* message) {
if (!message->m_promptString.empty()) { if (!message->m_promptString.empty()) {
text.append(message->m_promptString); text.append(message->m_promptString);
} else if (message->m_promptId >= 0) { } else if (message->m_promptId >= 0) {
AUTO_VAR(it, messages.find(message->m_promptId)); auto it = messages.find(message->m_promptId);
if (it != messages.end() && it->second != NULL) { if (it != messages.end() && it->second != NULL) {
TutorialMessage* prompt = it->second; TutorialMessage* prompt = it->second;
text.append(prompt->getMessageForDisplay()); text.append(prompt->getMessageForDisplay());
@ -2555,7 +2555,7 @@ void Tutorial::showTutorialPopup(bool show) {
void Tutorial::useItemOn(Level* level, std::shared_ptr<ItemInstance> item, void Tutorial::useItemOn(Level* level, std::shared_ptr<ItemInstance> item,
int x, int y, int z, bool bTestUseOnly) { int x, int y, int z, bool bTestUseOnly) {
for (AUTO_VAR(it, activeTasks[m_CurrentState].begin()); for (auto it = activeTasks[m_CurrentState].begin();
it < activeTasks[m_CurrentState].end(); ++it) { it < activeTasks[m_CurrentState].end(); ++it) {
TutorialTask* task = *it; TutorialTask* task = *it;
task->useItemOn(level, item, x, y, z, bTestUseOnly); task->useItemOn(level, item, x, y, z, bTestUseOnly);
@ -2564,7 +2564,7 @@ void Tutorial::useItemOn(Level* level, std::shared_ptr<ItemInstance> item,
void Tutorial::useItemOn(std::shared_ptr<ItemInstance> item, void Tutorial::useItemOn(std::shared_ptr<ItemInstance> item,
bool bTestUseOnly) { bool bTestUseOnly) {
for (AUTO_VAR(it, activeTasks[m_CurrentState].begin()); for (auto it = activeTasks[m_CurrentState].begin();
it < activeTasks[m_CurrentState].end(); ++it) { it < activeTasks[m_CurrentState].end(); ++it) {
TutorialTask* task = *it; TutorialTask* task = *it;
task->useItem(item, bTestUseOnly); task->useItem(item, bTestUseOnly);
@ -2572,7 +2572,7 @@ void Tutorial::useItemOn(std::shared_ptr<ItemInstance> item,
} }
void Tutorial::completeUsingItem(std::shared_ptr<ItemInstance> item) { void Tutorial::completeUsingItem(std::shared_ptr<ItemInstance> item) {
for (AUTO_VAR(it, activeTasks[m_CurrentState].begin()); for (auto it = activeTasks[m_CurrentState].begin();
it < activeTasks[m_CurrentState].end(); ++it) { it < activeTasks[m_CurrentState].end(); ++it) {
TutorialTask* task = *it; TutorialTask* task = *it;
task->completeUsingItem(item); task->completeUsingItem(item);
@ -2581,7 +2581,7 @@ void Tutorial::completeUsingItem(std::shared_ptr<ItemInstance> item) {
// Fix for #46922 - TU5: UI: Player receives a reminder that he is hungry // Fix for #46922 - TU5: UI: Player receives a reminder that he is hungry
// while "hunger bar" is full (triggered in split-screen mode) // while "hunger bar" is full (triggered in split-screen mode)
if (m_CurrentState != e_Tutorial_State_Gameplay) { if (m_CurrentState != e_Tutorial_State_Gameplay) {
for (AUTO_VAR(it, activeTasks[e_Tutorial_State_Gameplay].begin()); for (auto it = activeTasks[e_Tutorial_State_Gameplay].begin();
it < activeTasks[e_Tutorial_State_Gameplay].end(); ++it) { it < activeTasks[e_Tutorial_State_Gameplay].end(); ++it) {
TutorialTask* task = *it; TutorialTask* task = *it;
task->completeUsingItem(item); task->completeUsingItem(item);
@ -2592,7 +2592,7 @@ void Tutorial::completeUsingItem(std::shared_ptr<ItemInstance> item) {
void Tutorial::startDestroyBlock(std::shared_ptr<ItemInstance> item, void Tutorial::startDestroyBlock(std::shared_ptr<ItemInstance> item,
Tile* tile) { Tile* tile) {
int hintNeeded = -1; int hintNeeded = -1;
for (AUTO_VAR(it, hints[m_CurrentState].begin()); for (auto it = hints[m_CurrentState].begin();
it < hints[m_CurrentState].end(); ++it) { it < hints[m_CurrentState].end(); ++it) {
TutorialHint* hint = *it; TutorialHint* hint = *it;
hintNeeded = hint->startDestroyBlock(item, tile); hintNeeded = hint->startDestroyBlock(item, tile);
@ -2607,7 +2607,7 @@ void Tutorial::startDestroyBlock(std::shared_ptr<ItemInstance> item,
void Tutorial::destroyBlock(Tile* tile) { void Tutorial::destroyBlock(Tile* tile) {
int hintNeeded = -1; int hintNeeded = -1;
for (AUTO_VAR(it, hints[m_CurrentState].begin()); for (auto it = hints[m_CurrentState].begin();
it < hints[m_CurrentState].end(); ++it) { it < hints[m_CurrentState].end(); ++it) {
TutorialHint* hint = *it; TutorialHint* hint = *it;
hintNeeded = hint->destroyBlock(tile); hintNeeded = hint->destroyBlock(tile);
@ -2623,7 +2623,7 @@ void Tutorial::destroyBlock(Tile* tile) {
void Tutorial::attack(std::shared_ptr<Player> player, void Tutorial::attack(std::shared_ptr<Player> player,
std::shared_ptr<Entity> entity) { std::shared_ptr<Entity> entity) {
int hintNeeded = -1; int hintNeeded = -1;
for (AUTO_VAR(it, hints[m_CurrentState].begin()); for (auto it = hints[m_CurrentState].begin();
it < hints[m_CurrentState].end(); ++it) { it < hints[m_CurrentState].end(); ++it) {
TutorialHint* hint = *it; TutorialHint* hint = *it;
hintNeeded = hint->attack(player->inventory->getSelected(), entity); hintNeeded = hint->attack(player->inventory->getSelected(), entity);
@ -2638,7 +2638,7 @@ void Tutorial::attack(std::shared_ptr<Player> player,
void Tutorial::itemDamaged(std::shared_ptr<ItemInstance> item) { void Tutorial::itemDamaged(std::shared_ptr<ItemInstance> item) {
int hintNeeded = -1; int hintNeeded = -1;
for (AUTO_VAR(it, hints[m_CurrentState].begin()); for (auto it = hints[m_CurrentState].begin();
it < hints[m_CurrentState].end(); ++it) { it < hints[m_CurrentState].end(); ++it) {
TutorialHint* hint = *it; TutorialHint* hint = *it;
hintNeeded = hint->itemDamaged(item); hintNeeded = hint->itemDamaged(item);
@ -2654,7 +2654,7 @@ void Tutorial::itemDamaged(std::shared_ptr<ItemInstance> item) {
void Tutorial::handleUIInput(int iAction) { void Tutorial::handleUIInput(int iAction) {
if (m_hintDisplayed) return; if (m_hintDisplayed) return;
// for(AUTO_VAR(it, activeTasks[m_CurrentState].begin()); it < // for(auto it = activeTasks[m_CurrentState].begin(); it <
// activeTasks[m_CurrentState].end(); ++it) // activeTasks[m_CurrentState].end(); ++it)
//{ //{
// TutorialTask *task = *it; // TutorialTask *task = *it;
@ -2667,7 +2667,7 @@ void Tutorial::handleUIInput(int iAction) {
void Tutorial::createItemSelected(std::shared_ptr<ItemInstance> item, void Tutorial::createItemSelected(std::shared_ptr<ItemInstance> item,
bool canMake) { bool canMake) {
int hintNeeded = -1; int hintNeeded = -1;
for (AUTO_VAR(it, hints[m_CurrentState].begin()); for (auto it = hints[m_CurrentState].begin();
it < hints[m_CurrentState].end(); ++it) { it < hints[m_CurrentState].end(); ++it) {
TutorialHint* hint = *it; TutorialHint* hint = *it;
hintNeeded = hint->createItemSelected(item, canMake); hintNeeded = hint->createItemSelected(item, canMake);
@ -2682,7 +2682,7 @@ void Tutorial::createItemSelected(std::shared_ptr<ItemInstance> item,
void Tutorial::onCrafted(std::shared_ptr<ItemInstance> item) { void Tutorial::onCrafted(std::shared_ptr<ItemInstance> item) {
for (unsigned int state = 0; state < e_Tutorial_State_Max; ++state) { for (unsigned int state = 0; state < e_Tutorial_State_Max; ++state) {
for (AUTO_VAR(it, activeTasks[state].begin()); for (auto it = activeTasks[state].begin();
it < activeTasks[state].end(); ++it) { it < activeTasks[state].end(); ++it) {
TutorialTask* task = *it; TutorialTask* task = *it;
task->onCrafted(item); task->onCrafted(item);
@ -2695,7 +2695,7 @@ void Tutorial::onTake(std::shared_ptr<ItemInstance> item,
unsigned int invItemCountThisAux) { unsigned int invItemCountThisAux) {
if (!m_hintDisplayed) { if (!m_hintDisplayed) {
bool hintNeeded = false; bool hintNeeded = false;
for (AUTO_VAR(it, hints[m_CurrentState].begin()); for (auto it = hints[m_CurrentState].begin();
it < hints[m_CurrentState].end(); ++it) { it < hints[m_CurrentState].end(); ++it) {
TutorialHint* hint = *it; TutorialHint* hint = *it;
hintNeeded = hint->onTake(item); hintNeeded = hint->onTake(item);
@ -2706,7 +2706,7 @@ void Tutorial::onTake(std::shared_ptr<ItemInstance> item,
} }
for (unsigned int state = 0; state < e_Tutorial_State_Max; ++state) { for (unsigned int state = 0; state < e_Tutorial_State_Max; ++state) {
for (AUTO_VAR(it, activeTasks[state].begin()); for (auto it = activeTasks[state].begin();
it < activeTasks[state].end(); ++it) { it < activeTasks[state].end(); ++it) {
TutorialTask* task = *it; TutorialTask* task = *it;
task->onTake(item, invItemCountAnyAux, invItemCountThisAux); task->onTake(item, invItemCountAnyAux, invItemCountThisAux);
@ -2738,7 +2738,7 @@ void Tutorial::onLookAt(int id, int iData) {
if (m_hintDisplayed) return; if (m_hintDisplayed) return;
bool hintNeeded = false; bool hintNeeded = false;
for (AUTO_VAR(it, hints[m_CurrentState].begin()); for (auto it = hints[m_CurrentState].begin();
it < hints[m_CurrentState].end(); ++it) { it < hints[m_CurrentState].end(); ++it) {
TutorialHint* hint = *it; TutorialHint* hint = *it;
hintNeeded = hint->onLookAt(id, iData); hintNeeded = hint->onLookAt(id, iData);
@ -2764,7 +2764,7 @@ void Tutorial::onLookAtEntity(std::shared_ptr<Entity> entity) {
if (m_hintDisplayed) return; if (m_hintDisplayed) return;
bool hintNeeded = false; bool hintNeeded = false;
for (AUTO_VAR(it, hints[m_CurrentState].begin()); for (auto it = hints[m_CurrentState].begin();
it < hints[m_CurrentState].end(); ++it) { it < hints[m_CurrentState].end(); ++it) {
TutorialHint* hint = *it; TutorialHint* hint = *it;
hintNeeded = hint->onLookAtEntity(entity->GetType()); hintNeeded = hint->onLookAtEntity(entity->GetType());
@ -2778,7 +2778,7 @@ void Tutorial::onLookAtEntity(std::shared_ptr<Entity> entity) {
changeTutorialState(e_Tutorial_State_Horse); changeTutorialState(e_Tutorial_State_Horse);
} }
for (AUTO_VAR(it, activeTasks[m_CurrentState].begin()); for (auto it = activeTasks[m_CurrentState].begin();
it != activeTasks[m_CurrentState].end(); ++it) { it != activeTasks[m_CurrentState].end(); ++it) {
(*it)->onLookAtEntity(entity); (*it)->onLookAtEntity(entity);
} }
@ -2798,14 +2798,14 @@ void Tutorial::onRideEntity(std::shared_ptr<Entity> entity) {
} }
} }
for (AUTO_VAR(it, activeTasks[m_CurrentState].begin()); for (auto it = activeTasks[m_CurrentState].begin();
it != activeTasks[m_CurrentState].end(); ++it) { it != activeTasks[m_CurrentState].end(); ++it) {
(*it)->onRideEntity(entity); (*it)->onRideEntity(entity);
} }
} }
void Tutorial::onEffectChanged(MobEffect* effect, bool bRemoved) { void Tutorial::onEffectChanged(MobEffect* effect, bool bRemoved) {
for (AUTO_VAR(it, activeTasks[m_CurrentState].begin()); for (auto it = activeTasks[m_CurrentState].begin();
it < activeTasks[m_CurrentState].end(); ++it) { it < activeTasks[m_CurrentState].end(); ++it) {
TutorialTask* task = *it; TutorialTask* task = *it;
task->onEffectChanged(effect, bRemoved); task->onEffectChanged(effect, bRemoved);
@ -2815,7 +2815,7 @@ void Tutorial::onEffectChanged(MobEffect* effect, bool bRemoved) {
bool Tutorial::canMoveToPosition(double xo, double yo, double zo, double xt, bool Tutorial::canMoveToPosition(double xo, double yo, double zo, double xt,
double yt, double zt) { double yt, double zt) {
bool allowed = true; bool allowed = true;
for (AUTO_VAR(it, constraints[m_CurrentState].begin()); for (auto it = constraints[m_CurrentState].begin();
it < constraints[m_CurrentState].end(); ++it) { it < constraints[m_CurrentState].end(); ++it) {
TutorialConstraint* constraint = *it; TutorialConstraint* constraint = *it;
if (!constraint->isConstraintSatisfied(m_iPad) && if (!constraint->isConstraintSatisfied(m_iPad) &&
@ -2837,7 +2837,7 @@ bool Tutorial::isInputAllowed(int mapping) {
return true; return true;
bool allowed = true; bool allowed = true;
for (AUTO_VAR(it, constraints[m_CurrentState].begin()); for (auto it = constraints[m_CurrentState].begin();
it < constraints[m_CurrentState].end(); ++it) { it < constraints[m_CurrentState].end(); ++it) {
TutorialConstraint* constraint = *it; TutorialConstraint* constraint = *it;
if (constraint->isMappingConstrained(m_iPad, mapping)) { if (constraint->isMappingConstrained(m_iPad, mapping)) {
@ -2852,7 +2852,7 @@ std::vector<TutorialTask*>* Tutorial::getTasks() { return &tasks; }
unsigned int Tutorial::getCurrentTaskIndex() { unsigned int Tutorial::getCurrentTaskIndex() {
unsigned int index = 0; unsigned int index = 0;
for (AUTO_VAR(it, tasks.begin()); it < tasks.end(); ++it) { for (auto it = tasks.begin(); it < tasks.end(); ++it) {
if (*it == currentTask[e_Tutorial_State_Gameplay]) break; if (*it == currentTask[e_Tutorial_State_Gameplay]) break;
++index; ++index;
@ -2875,7 +2875,7 @@ void Tutorial::RemoveConstraint(TutorialConstraint* c,
if (c->getQueuedForRemoval()) { if (c->getQueuedForRemoval()) {
// If it is already queued for removal, remove it on the next tick // If it is already queued for removal, remove it on the next tick
/*for(AUTO_VAR(it, constraintsToRemove[m_CurrentState].begin()); it < /*for(auto it = constraintsToRemove[m_CurrentState].begin(); it <
constraintsToRemove[m_CurrentState].end(); ++it) constraintsToRemove[m_CurrentState].end(); ++it)
{ {
if( it->first == c ) if( it->first == c )
@ -2889,7 +2889,7 @@ void Tutorial::RemoveConstraint(TutorialConstraint* c,
constraintsToRemove[m_CurrentState].push_back( constraintsToRemove[m_CurrentState].push_back(
std::pair<TutorialConstraint*, unsigned char>(c, 0)); std::pair<TutorialConstraint*, unsigned char>(c, 0));
} else { } else {
for (AUTO_VAR(it, constraintsToRemove[m_CurrentState].begin()); for (auto it = constraintsToRemove[m_CurrentState].begin();
it < constraintsToRemove[m_CurrentState].end(); ++it) { it < constraintsToRemove[m_CurrentState].end(); ++it) {
if (it->first == c) { if (it->first == c) {
constraintsToRemove[m_CurrentState].erase(it); constraintsToRemove[m_CurrentState].erase(it);
@ -2897,8 +2897,8 @@ void Tutorial::RemoveConstraint(TutorialConstraint* c,
} }
} }
AUTO_VAR(it, find(constraints[m_CurrentState].begin(), auto it = find(constraints[m_CurrentState].begin(),
constraints[m_CurrentState].end(), c)); constraints[m_CurrentState].end(), c);
if (it != constraints[m_CurrentState].end()) if (it != constraints[m_CurrentState].end())
constraints[m_CurrentState].erase( constraints[m_CurrentState].erase(
find(constraints[m_CurrentState].begin(), find(constraints[m_CurrentState].begin(),
@ -2990,7 +2990,7 @@ void Tutorial::changeTutorialState(eTutorial_State newState,
m_UIScene = scene; m_UIScene = scene;
if (m_CurrentState != newState) { if (m_CurrentState != newState) {
for (AUTO_VAR(it, activeTasks[newState].begin()); for (auto it = activeTasks[newState].begin();
it < activeTasks[newState].end(); ++it) { it < activeTasks[newState].end(); ++it) {
TutorialTask* task = *it; TutorialTask* task = *it;
task->onStateChange(newState); task->onStateChange(newState);

View file

@ -20,7 +20,7 @@ TutorialTask::TutorialTask(Tutorial* tutorial, int descriptionId,
m_bShowMinimumTime(bShowMinimumTime), m_bShowMinimumTime(bShowMinimumTime),
m_bShownForMinimumTime(false) { m_bShownForMinimumTime(false) {
if (inConstraints != NULL) { if (inConstraints != NULL) {
for (AUTO_VAR(it, inConstraints->begin()); it < inConstraints->end(); for (auto it = inConstraints->begin(); it < inConstraints->end();
++it) { ++it) {
TutorialConstraint* constraint = *it; TutorialConstraint* constraint = *it;
constraints.push_back(constraint); constraints.push_back(constraint);
@ -34,7 +34,7 @@ TutorialTask::TutorialTask(Tutorial* tutorial, int descriptionId,
TutorialTask::~TutorialTask() { TutorialTask::~TutorialTask() {
enableConstraints(false); enableConstraints(false);
for (AUTO_VAR(it, constraints.begin()); it < constraints.end(); ++it) { for (auto it = constraints.begin(); it < constraints.end(); ++it) {
TutorialConstraint* constraint = *it; TutorialConstraint* constraint = *it;
if (constraint->getQueuedForRemoval()) { if (constraint->getQueuedForRemoval()) {
@ -53,7 +53,7 @@ void TutorialTask::enableConstraints(bool enable,
bool delayRemove /*= false*/) { bool delayRemove /*= false*/) {
if (!enable && (areConstraintsEnabled || !delayRemove)) { if (!enable && (areConstraintsEnabled || !delayRemove)) {
// Remove // Remove
for (AUTO_VAR(it, constraints.begin()); it != constraints.end(); ++it) { for (auto it = constraints.begin(); it != constraints.end(); ++it) {
TutorialConstraint* constraint = *it; TutorialConstraint* constraint = *it;
// app.DebugPrintf(">>>>>>>> %i\n", constraints.size()); // app.DebugPrintf(">>>>>>>> %i\n", constraints.size());
tutorial->RemoveConstraint(constraint, delayRemove); tutorial->RemoveConstraint(constraint, delayRemove);
@ -61,7 +61,7 @@ void TutorialTask::enableConstraints(bool enable,
areConstraintsEnabled = false; areConstraintsEnabled = false;
} else if (!areConstraintsEnabled && enable) { } else if (!areConstraintsEnabled && enable) {
// Add // Add
for (AUTO_VAR(it, constraints.begin()); it != constraints.end(); ++it) { for (auto it = constraints.begin(); it != constraints.end(); ++it) {
TutorialConstraint* constraint = *it; TutorialConstraint* constraint = *it;
tutorial->AddConstraint(constraint); tutorial->AddConstraint(constraint);
} }

View file

@ -631,7 +631,7 @@ void IUIScene_CraftingMenu::CheckRecipesAvailable() {
Recipy::INGREDIENTS_REQUIRED* pRecipeIngredientsRequired = Recipy::INGREDIENTS_REQUIRED* pRecipeIngredientsRequired =
Recipes::getInstance()->getRecipeIngredientsArray(); Recipes::getInstance()->getRecipeIngredientsArray();
int iRecipeC = (int)recipes->size(); int iRecipeC = (int)recipes->size();
AUTO_VAR(itRecipe, recipes->begin()); auto itRecipe = recipes->begin();
// dump out the recipe products // dump out the recipe products

View file

@ -982,8 +982,8 @@ void IUIScene_CreativeMenu::TabSpec::populateMenu(AbstractContainerMenu* menu,
// Fill the dynamic group // Fill the dynamic group
if (m_dynamicGroupsCount > 0 && m_dynamicGroupsA != NULL) { if (m_dynamicGroupsCount > 0 && m_dynamicGroupsA != NULL) {
for (AUTO_VAR(it, for (auto it=
categoryGroups[m_dynamicGroupsA[dynamicIndex]].rbegin()); categoryGroups[m_dynamicGroupsA[dynamicIndex]].rbegin();
it != categoryGroups[m_dynamicGroupsA[dynamicIndex]].rend() && it != categoryGroups[m_dynamicGroupsA[dynamicIndex]].rend() &&
lastSlotIndex < MAX_SIZE; lastSlotIndex < MAX_SIZE;
++it) { ++it) {

View file

@ -180,7 +180,7 @@ void IUIScene_TradingMenu::updateDisplay() {
m_activeOffers.clear(); m_activeOffers.clear();
int unfilteredIndex = 0; int unfilteredIndex = 0;
int firstValidTrade = INT_MAX; int firstValidTrade = INT_MAX;
for (AUTO_VAR(it, unfilteredOffers->begin()); for (auto it = unfilteredOffers->begin();
it != unfilteredOffers->end(); ++it) { it != unfilteredOffers->end(); ++it) {
MerchantRecipe* recipe = *it; MerchantRecipe* recipe = *it;
if (!recipe->isDeprecated()) { if (!recipe->isDeprecated()) {

View file

@ -214,7 +214,7 @@ void UIControl_PlayerSkinPreview::render(IggyCustomDrawCallbackRegion* region) {
// *pAdditionalModelParts=mob->GetAdditionalModelParts(); // *pAdditionalModelParts=mob->GetAdditionalModelParts();
if (m_pvAdditionalModelParts && m_pvAdditionalModelParts->size() != 0) { if (m_pvAdditionalModelParts && m_pvAdditionalModelParts->size() != 0) {
for (AUTO_VAR(it, m_pvAdditionalModelParts->begin()); for (auto it = m_pvAdditionalModelParts->begin();
it != m_pvAdditionalModelParts->end(); ++it) { it != m_pvAdditionalModelParts->end(); ++it) {
ModelPart* pModelPart = *it; ModelPart* pModelPart = *it;
@ -227,7 +227,7 @@ void UIControl_PlayerSkinPreview::render(IggyCustomDrawCallbackRegion* region) {
// hide the additional parts // hide the additional parts
if (m_pvAdditionalModelParts && m_pvAdditionalModelParts->size() != 0) { if (m_pvAdditionalModelParts && m_pvAdditionalModelParts->size() != 0) {
for (AUTO_VAR(it, m_pvAdditionalModelParts->begin()); for (auto it = m_pvAdditionalModelParts->begin();
it != m_pvAdditionalModelParts->end(); ++it) { it != m_pvAdditionalModelParts->end(); ++it) {
ModelPart* pModelPart = *it; ModelPart* pModelPart = *it;

View file

@ -452,7 +452,7 @@ void UIController::tick() {
// Clear out the cached movie file data // Clear out the cached movie file data
int64_t currentTime = System::currentTimeMillis(); int64_t currentTime = System::currentTimeMillis();
for (AUTO_VAR(it, m_cachedMovieData.begin()); for (auto it = m_cachedMovieData.begin();
it != m_cachedMovieData.end();) { it != m_cachedMovieData.end();) {
if (it->second.m_expiry < currentTime) { if (it->second.m_expiry < currentTime) {
delete[] it->second.m_ba.data; delete[] it->second.m_ba.data;
@ -667,7 +667,7 @@ void UIController::CleanUpSkinReload() {
} }
} }
for (AUTO_VAR(it, m_queuedMessageBoxData.begin()); for (auto it = m_queuedMessageBoxData.begin();
it != m_queuedMessageBoxData.end(); ++it) { it != m_queuedMessageBoxData.end(); ++it) {
QueuedMessageBoxData* queuedData = *it; QueuedMessageBoxData* queuedData = *it;
ui.NavigateToScene(queuedData->iPad, eUIScene_MessageBox, ui.NavigateToScene(queuedData->iPad, eUIScene_MessageBox,
@ -682,7 +682,7 @@ void UIController::CleanUpSkinReload() {
byteArray UIController::getMovieData(const std::wstring& filename) { byteArray UIController::getMovieData(const std::wstring& filename) {
// Cache everything we load in the current tick // Cache everything we load in the current tick
int64_t targetTime = System::currentTimeMillis() + (1000LL * 60); int64_t targetTime = System::currentTimeMillis() + (1000LL * 60);
AUTO_VAR(it, m_cachedMovieData.find(filename)); auto it = m_cachedMovieData.find(filename);
if (it == m_cachedMovieData.end()) { if (it == m_cachedMovieData.end()) {
byteArray baFile = app.getArchiveFile(filename); byteArray baFile = app.getArchiveFile(filename);
CachedMovieData cmd; CachedMovieData cmd;
@ -1095,8 +1095,8 @@ GDrawTexture* RADLINK UIController::TextureSubstitutionCreateCallback(
void* user_callback_data, IggyUTF16* texture_name, S32* width, S32* height, void* user_callback_data, IggyUTF16* texture_name, S32* width, S32* height,
void** destroy_callback_data) { void** destroy_callback_data) {
UIController* uiController = (UIController*)user_callback_data; UIController* uiController = (UIController*)user_callback_data;
AUTO_VAR(it, auto it =
uiController->m_substitutionTextures.find((wchar_t*)texture_name)); uiController->m_substitutionTextures.find((wchar_t*)texture_name);
if (it != uiController->m_substitutionTextures.end()) { if (it != uiController->m_substitutionTextures.end()) {
app.DebugPrintf("Found substitution texture %ls, with %d bytes\n", app.DebugPrintf("Found substitution texture %ls, with %d bytes\n",
@ -1158,7 +1158,7 @@ void UIController::registerSubstitutionTexture(const std::wstring& textureName,
void UIController::unregisterSubstitutionTexture( void UIController::unregisterSubstitutionTexture(
const std::wstring& textureName, bool deleteData) { const std::wstring& textureName, bool deleteData) {
AUTO_VAR(it, m_substitutionTextures.find(textureName)); auto it = m_substitutionTextures.find(textureName);
if (it != m_substitutionTextures.end()) { if (it != m_substitutionTextures.end()) {
if (deleteData) delete[] it->second.data; if (deleteData) delete[] it->second.data;
@ -1393,7 +1393,7 @@ size_t UIController::RegisterForCallbackId(UIScene* scene) {
void UIController::UnregisterCallbackId(size_t id) { void UIController::UnregisterCallbackId(size_t id) {
EnterCriticalSection(&m_registeredCallbackScenesCS); EnterCriticalSection(&m_registeredCallbackScenesCS);
AUTO_VAR(it, m_registeredCallbackScenes.find(id)); auto it = m_registeredCallbackScenes.find(id);
if (it != m_registeredCallbackScenes.end()) { if (it != m_registeredCallbackScenes.end()) {
m_registeredCallbackScenes.erase(it); m_registeredCallbackScenes.erase(it);
} }
@ -1402,7 +1402,7 @@ void UIController::UnregisterCallbackId(size_t id) {
UIScene* UIController::GetSceneFromCallbackId(size_t id) { UIScene* UIController::GetSceneFromCallbackId(size_t id) {
UIScene* scene = NULL; UIScene* scene = NULL;
AUTO_VAR(it, m_registeredCallbackScenes.find(id)); auto it = m_registeredCallbackScenes.find(id);
if (it != m_registeredCallbackScenes.end()) { if (it != m_registeredCallbackScenes.end()) {
scene = it->second; scene = it->second;
} }

View file

@ -18,7 +18,7 @@ void UILayer::tick() {
// so we need to make a copy of the scenes that we are going to try and // so we need to make a copy of the scenes that we are going to try and
// destroy this tick // destroy this tick
std::vector<UIScene*> scenesToDeleteCopy; std::vector<UIScene*> scenesToDeleteCopy;
for (AUTO_VAR(it, m_scenesToDelete.begin()); it != m_scenesToDelete.end(); for (auto it = m_scenesToDelete.begin(); it != m_scenesToDelete.end();
it++) { it++) {
UIScene* scene = (*it); UIScene* scene = (*it);
scenesToDeleteCopy.push_back(scene); scenesToDeleteCopy.push_back(scene);
@ -28,7 +28,7 @@ void UILayer::tick() {
// Delete the scenes in our copy if they are ready to delete, otherwise add // Delete the scenes in our copy if they are ready to delete, otherwise add
// back to the ones that are still to be deleted. Actually deleting a scene // back to the ones that are still to be deleted. Actually deleting a scene
// might also add something back into m_scenesToDelete. // might also add something back into m_scenesToDelete.
for (AUTO_VAR(it, scenesToDeleteCopy.begin()); for (auto it = scenesToDeleteCopy.begin();
it != scenesToDeleteCopy.end(); it++) { it != scenesToDeleteCopy.end(); it++) {
UIScene* scene = (*it); UIScene* scene = (*it);
if (scene->isReadyToDelete()) { if (scene->isReadyToDelete()) {
@ -45,12 +45,12 @@ void UILayer::tick() {
} }
m_scenesToDestroy.clear(); m_scenesToDestroy.clear();
for (AUTO_VAR(it, m_components.begin()); it != m_components.end(); ++it) { for (auto it = m_components.begin(); it != m_components.end(); ++it) {
(*it)->tick(); (*it)->tick();
} }
// Note: reverse iterator, the last element is the top of the stack // Note: reverse iterator, the last element is the top of the stack
int sceneIndex = m_sceneStack.size() - 1; int sceneIndex = m_sceneStack.size() - 1;
// for(AUTO_VAR(it,m_sceneStack.rbegin()); it != m_sceneStack.rend(); ++it) // for(auto it = m_sceneStack.rbegin(); it != m_sceneStack.rend(); ++it)
while (sceneIndex >= 0 && sceneIndex < m_sceneStack.size()) { while (sceneIndex >= 0 && sceneIndex < m_sceneStack.size()) {
//(*it)->tick(); //(*it)->tick();
UIScene* scene = m_sceneStack[sceneIndex]; UIScene* scene = m_sceneStack[sceneIndex];
@ -63,9 +63,9 @@ void UILayer::tick() {
void UILayer::render(S32 width, S32 height, C4JRender::eViewportType viewport) { void UILayer::render(S32 width, S32 height, C4JRender::eViewportType viewport) {
if (!ui.IsExpectingOrReloadingSkin()) { if (!ui.IsExpectingOrReloadingSkin()) {
for (AUTO_VAR(it, m_components.begin()); it != m_components.end(); for (auto it = m_components.begin(); it != m_components.end();
++it) { ++it) {
AUTO_VAR(itRef, m_componentRefCount.find((*it)->getSceneType())); auto itRef = m_componentRefCount.find((*it)->getSceneType());
if (itRef != m_componentRefCount.end() && itRef->second.second) { if (itRef != m_componentRefCount.end() && itRef->second.second) {
if ((*it)->isVisible()) { if ((*it)->isVisible()) {
PIXBeginNamedEvent(0, "Rendering component %d", PIXBeginNamedEvent(0, "Rendering component %d",
@ -125,7 +125,7 @@ bool UILayer::HasFocus(int iPad) {
bool UILayer::hidesLowerScenes() { bool UILayer::hidesLowerScenes() {
bool hidesScenes = false; bool hidesScenes = false;
for (AUTO_VAR(it, m_components.begin()); it != m_components.end(); ++it) { for (auto it = m_components.begin(); it != m_components.end(); ++it) {
if ((*it)->hidesLowerScenes()) { if ((*it)->hidesLowerScenes()) {
hidesScenes = true; hidesScenes = true;
break; break;
@ -147,16 +147,16 @@ void UILayer::getRenderDimensions(S32& width, S32& height) {
} }
void UILayer::DestroyAll() { void UILayer::DestroyAll() {
for (AUTO_VAR(it, m_components.begin()); it != m_components.end(); ++it) { for (auto it = m_components.begin(); it != m_components.end(); ++it) {
(*it)->destroyMovie(); (*it)->destroyMovie();
} }
for (AUTO_VAR(it, m_sceneStack.begin()); it != m_sceneStack.end(); ++it) { for (auto it = m_sceneStack.begin(); it != m_sceneStack.end(); ++it) {
(*it)->destroyMovie(); (*it)->destroyMovie();
} }
} }
void UILayer::ReloadAll(bool force) { void UILayer::ReloadAll(bool force) {
for (AUTO_VAR(it, m_components.begin()); it != m_components.end(); ++it) { for (auto it = m_components.begin(); it != m_components.end(); ++it) {
(*it)->reloadMovie(force); (*it)->reloadMovie(force);
} }
if (!m_sceneStack.empty()) { if (!m_sceneStack.empty()) {
@ -437,7 +437,7 @@ bool UILayer::NavigateBack(int iPad, EUIScene eScene) {
} }
void UILayer::showComponent(int iPad, EUIScene scene, bool show) { void UILayer::showComponent(int iPad, EUIScene scene, bool show) {
AUTO_VAR(it, m_componentRefCount.find(scene)); auto it = m_componentRefCount.find(scene);
if (it != m_componentRefCount.end()) { if (it != m_componentRefCount.end()) {
it->second.second = show; it->second.second = show;
return; return;
@ -447,7 +447,7 @@ void UILayer::showComponent(int iPad, EUIScene scene, bool show) {
bool UILayer::isComponentVisible(EUIScene scene) { bool UILayer::isComponentVisible(EUIScene scene) {
bool visible = false; bool visible = false;
AUTO_VAR(it, m_componentRefCount.find(scene)); auto it = m_componentRefCount.find(scene);
if (it != m_componentRefCount.end()) { if (it != m_componentRefCount.end()) {
visible = it->second.second; visible = it->second.second;
} }
@ -455,11 +455,11 @@ bool UILayer::isComponentVisible(EUIScene scene) {
} }
UIScene* UILayer::addComponent(int iPad, EUIScene scene, void* initData) { UIScene* UILayer::addComponent(int iPad, EUIScene scene, void* initData) {
AUTO_VAR(it, m_componentRefCount.find(scene)); auto it = m_componentRefCount.find(scene);
if (it != m_componentRefCount.end()) { if (it != m_componentRefCount.end()) {
++it->second.first; ++it->second.first;
for (AUTO_VAR(itComp, m_components.begin()); for (auto itComp = m_components.begin();
itComp != m_components.end(); ++itComp) { itComp != m_components.end(); ++itComp) {
if ((*itComp)->getSceneType() == scene) { if ((*itComp)->getSceneType() == scene) {
return *itComp; return *itComp;
@ -525,13 +525,13 @@ UIScene* UILayer::addComponent(int iPad, EUIScene scene, void* initData) {
} }
void UILayer::removeComponent(EUIScene scene) { void UILayer::removeComponent(EUIScene scene) {
AUTO_VAR(it, m_componentRefCount.find(scene)); auto it = m_componentRefCount.find(scene);
if (it != m_componentRefCount.end()) { if (it != m_componentRefCount.end()) {
--it->second.first; --it->second.first;
if (it->second.first <= 0) { if (it->second.first <= 0) {
m_componentRefCount.erase(it); m_componentRefCount.erase(it);
for (AUTO_VAR(compIt, m_components.begin()); for (auto compIt = m_components.begin();
compIt != m_components.end();) { compIt != m_components.end();) {
if ((*compIt)->getSceneType() == scene) { if ((*compIt)->getSceneType() == scene) {
m_scenesToDelete.push_back((*compIt)); m_scenesToDelete.push_back((*compIt));
@ -548,8 +548,8 @@ void UILayer::removeComponent(EUIScene scene) {
void UILayer::removeScene(UIScene* scene) { void UILayer::removeScene(UIScene* scene) {
AUTO_VAR(newEnd, auto newEnd =
std::remove(m_sceneStack.begin(), m_sceneStack.end(), scene)); std::remove(m_sceneStack.begin(), m_sceneStack.end(), scene);
m_sceneStack.erase(newEnd, m_sceneStack.end()); m_sceneStack.erase(newEnd, m_sceneStack.end());
m_scenesToDelete.push_back(scene); m_scenesToDelete.push_back(scene);
@ -571,7 +571,7 @@ void UILayer::closeAllScenes() {
std::vector<UIScene*> temp; std::vector<UIScene*> temp;
temp.insert(temp.end(), m_sceneStack.begin(), m_sceneStack.end()); temp.insert(temp.end(), m_sceneStack.begin(), m_sceneStack.end());
m_sceneStack.clear(); m_sceneStack.clear();
for (AUTO_VAR(it, temp.begin()); it != temp.end(); ++it) { for (auto it = temp.begin(); it != temp.end(); ++it) {
m_scenesToDelete.push_back(*it); m_scenesToDelete.push_back(*it);
(*it)->handleDestroy(); // For anything that might require the pointer (*it)->handleDestroy(); // For anything that might require the pointer
// be valid // be valid
@ -612,7 +612,7 @@ bool UILayer::updateFocusState(bool allowedFocus /* = false */) {
m_bIgnorePlayerJoinMenuDisplayed = false; m_bIgnorePlayerJoinMenuDisplayed = false;
bool layerFocusSet = false; bool layerFocusSet = false;
for (AUTO_VAR(it, m_sceneStack.rbegin()); it != m_sceneStack.rend(); ++it) { for (auto it = m_sceneStack.rbegin(); it != m_sceneStack.rend(); ++it) {
UIScene* scene = *it; UIScene* scene = *it;
// UPDATE FOCUS STATES // UPDATE FOCUS STATES
@ -695,7 +695,7 @@ bool UILayer::updateFocusState(bool allowedFocus /* = false */) {
void UILayer::handleInput(int iPad, int key, bool repeat, bool pressed, void UILayer::handleInput(int iPad, int key, bool repeat, bool pressed,
bool released, bool& handled) { bool released, bool& handled) {
// Note: reverse iterator, the last element is the top of the stack // Note: reverse iterator, the last element is the top of the stack
for (AUTO_VAR(it, m_sceneStack.rbegin()); it != m_sceneStack.rend(); ++it) { for (auto it = m_sceneStack.rbegin(); it != m_sceneStack.rend(); ++it) {
UIScene* scene = *it; UIScene* scene = *it;
if (scene->hasFocus(iPad) && scene->canHandleInput()) { if (scene->hasFocus(iPad) && scene->canHandleInput()) {
// 4J-PB - ignore repeats of action ABXY buttons // 4J-PB - ignore repeats of action ABXY buttons
@ -719,7 +719,7 @@ void UILayer::handleInput(int iPad, int key, bool repeat, bool pressed,
} }
void UILayer::HandleDLCMountingComplete() { void UILayer::HandleDLCMountingComplete() {
for (AUTO_VAR(it, m_sceneStack.rbegin()); it != m_sceneStack.rend(); ++it) { for (auto it = m_sceneStack.rbegin(); it != m_sceneStack.rend(); ++it) {
UIScene* topScene = *it; UIScene* topScene = *it;
app.DebugPrintf("UILayer::HandleDLCMountingComplete - topScene\n"); app.DebugPrintf("UILayer::HandleDLCMountingComplete - topScene\n");
topScene->HandleDLCMountingComplete(); topScene->HandleDLCMountingComplete();
@ -727,7 +727,7 @@ void UILayer::HandleDLCMountingComplete() {
} }
void UILayer::HandleDLCInstalled() { void UILayer::HandleDLCInstalled() {
for (AUTO_VAR(it, m_sceneStack.rbegin()); it != m_sceneStack.rend(); ++it) { for (auto it = m_sceneStack.rbegin(); it != m_sceneStack.rend(); ++it) {
UIScene* topScene = *it; UIScene* topScene = *it;
topScene->HandleDLCInstalled(); topScene->HandleDLCInstalled();
} }
@ -735,7 +735,7 @@ void UILayer::HandleDLCInstalled() {
void UILayer::HandleMessage(EUIMessage message, void* data) { void UILayer::HandleMessage(EUIMessage message, void* data) {
for (AUTO_VAR(it, m_sceneStack.rbegin()); it != m_sceneStack.rend(); ++it) { for (auto it = m_sceneStack.rbegin(); it != m_sceneStack.rend(); ++it) {
UIScene* topScene = *it; UIScene* topScene = *it;
topScene->HandleMessage(message, data); topScene->HandleMessage(message, data);
} }
@ -748,7 +748,7 @@ C4JRender::eViewportType UILayer::getViewport() {
} }
void UILayer::handleUnlockFullVersion() { void UILayer::handleUnlockFullVersion() {
for (AUTO_VAR(it, m_sceneStack.begin()); it != m_sceneStack.end(); ++it) { for (auto it = m_sceneStack.begin(); it != m_sceneStack.end(); ++it) {
(*it)->handleUnlockFullVersion(); (*it)->handleUnlockFullVersion();
} }
} }
@ -757,10 +757,10 @@ void UILayer::PrintTotalMemoryUsage(int64_t& totalStatic,
int64_t& totalDynamic) { int64_t& totalDynamic) {
int64_t layerStatic = 0; int64_t layerStatic = 0;
int64_t layerDynamic = 0; int64_t layerDynamic = 0;
for (AUTO_VAR(it, m_components.begin()); it != m_components.end(); ++it) { for (auto it = m_components.begin(); it != m_components.end(); ++it) {
(*it)->PrintTotalMemoryUsage(layerStatic, layerDynamic); (*it)->PrintTotalMemoryUsage(layerStatic, layerDynamic);
} }
for (AUTO_VAR(it, m_sceneStack.begin()); it != m_sceneStack.end(); ++it) { for (auto it = m_sceneStack.begin(); it != m_sceneStack.end(); ++it) {
(*it)->PrintTotalMemoryUsage(layerStatic, layerDynamic); (*it)->PrintTotalMemoryUsage(layerStatic, layerDynamic);
} }
app.DebugPrintf(app.USER_SR, " \\- Layer static: %d , Layer dynamic: %d\n", app.DebugPrintf(app.USER_SR, " \\- Layer static: %d , Layer dynamic: %d\n",

View file

@ -38,7 +38,7 @@ UIScene::~UIScene() {
/* Destroy the Iggy player. */ /* Destroy the Iggy player. */
IggyPlayerDestroy(swf); IggyPlayerDestroy(swf);
for (AUTO_VAR(it, m_registeredTextures.begin()); for (auto it = m_registeredTextures.begin();
it != m_registeredTextures.end(); ++it) { it != m_registeredTextures.end(); ++it) {
ui.unregisterSubstitutionTexture(it->first, it->second); ui.unregisterSubstitutionTexture(it->first, it->second);
} }
@ -90,7 +90,7 @@ void UIScene::reloadMovie(bool force) {
handlePreReload(); handlePreReload();
// Reload controls // Reload controls
for (AUTO_VAR(it, m_controls.begin()); it != m_controls.end(); ++it) { for (auto it = m_controls.begin(); it != m_controls.end(); ++it) {
(*it)->ReInit(); (*it)->ReInit();
} }
@ -377,7 +377,7 @@ void UIScene::tick() {
if (m_hasTickedOnce) m_bCanHandleInput = true; if (m_hasTickedOnce) m_bCanHandleInput = true;
while (IggyPlayerReadyToTick(swf)) { while (IggyPlayerReadyToTick(swf)) {
tickTimers(); tickTimers();
for (AUTO_VAR(it, m_controls.begin()); it != m_controls.end(); ++it) { for (auto it = m_controls.begin(); it != m_controls.end(); ++it) {
(*it)->tick(); (*it)->tick();
} }
IggyPlayerTickRS(swf); IggyPlayerTickRS(swf);
@ -398,7 +398,7 @@ void UIScene::addTimer(int id, int ms) {
} }
void UIScene::killTimer(int id) { void UIScene::killTimer(int id) {
AUTO_VAR(it, m_timers.find(id)); auto it = m_timers.find(id);
if (it != m_timers.end()) { if (it != m_timers.end()) {
it->second.running = false; it->second.running = false;
} }
@ -406,7 +406,7 @@ void UIScene::killTimer(int id) {
void UIScene::tickTimers() { void UIScene::tickTimers() {
int currentTime = System::currentTimeMillis(); int currentTime = System::currentTimeMillis();
for (AUTO_VAR(it, m_timers.begin()); it != m_timers.end();) { for (auto it = m_timers.begin(); it != m_timers.end();) {
if (!it->second.running) { if (!it->second.running) {
it = m_timers.erase(it); it = m_timers.erase(it);
} else { } else {
@ -423,7 +423,7 @@ void UIScene::tickTimers() {
IggyName UIScene::registerFastName(const std::wstring& name) { IggyName UIScene::registerFastName(const std::wstring& name) {
IggyName var; IggyName var;
AUTO_VAR(it, m_fastNames.find(name)); auto it = m_fastNames.find(name);
if (it != m_fastNames.end()) { if (it != m_fastNames.end()) {
var = it->second; var = it->second;
} else { } else {
@ -551,7 +551,7 @@ void UIScene::customDrawSlotControl(IggyCustomDrawCallbackRegion* region,
PIXBeginNamedEvent(0, "Draw all cache"); PIXBeginNamedEvent(0, "Draw all cache");
// Draw all the cached slots // Draw all the cached slots
for (AUTO_VAR(it, m_cachedSlotDraw.begin()); for (auto it = m_cachedSlotDraw.begin();
it != m_cachedSlotDraw.end(); ++it) { it != m_cachedSlotDraw.end(); ++it) {
CachedSlotDrawData* drawData = *it; CachedSlotDrawData* drawData = *it;
ui.setupCustomDrawMatrices(this, ui.setupCustomDrawMatrices(this,
@ -1094,7 +1094,7 @@ void UIScene::registerSubstitutionTexture(const std::wstring& textureName,
bool UIScene::hasRegisteredSubstitutionTexture( bool UIScene::hasRegisteredSubstitutionTexture(
const std::wstring& textureName) { const std::wstring& textureName) {
AUTO_VAR(it, m_registeredTextures.find(textureName)); auto it = m_registeredTextures.find(textureName);
return it != m_registeredTextures.end(); return it != m_registeredTextures.end();
} }

View file

@ -192,7 +192,7 @@ void UIScene_EndPoem::updateNoise() {
std::wstring tag = L"{*NOISE*}"; std::wstring tag = L"{*NOISE*}";
AUTO_VAR(it, m_noiseLengths.begin()); auto it = m_noiseLengths.begin();
int found = (int)noiseString.find(tag); int found = (int)noiseString.find(tag);
while (found != std::string::npos && it != m_noiseLengths.end()) { while (found != std::string::npos && it != m_noiseLengths.end()) {
length = *it; length = *it;

View file

@ -260,7 +260,7 @@ void UIScene_InventoryMenu::updateEffectsDisplay() {
int iValue = 0; int iValue = 0;
IggyDataValue* UpdateValue = new IggyDataValue[activeEffects->size() * 2]; IggyDataValue* UpdateValue = new IggyDataValue[activeEffects->size() * 2];
for (AUTO_VAR(it, activeEffects->begin()); it != activeEffects->end(); for (auto it = activeEffects->begin(); it != activeEffects->end();
++it) { ++it) {
MobEffectInstance* effect = *it; MobEffectInstance* effect = *it;

View file

@ -166,7 +166,7 @@ UIScene_LoadOrJoinMenu::~UIScene_LoadOrJoinMenu() {
app.SetLiveLinkRequired(false); app.SetLiveLinkRequired(false);
if (m_currentSessions) { if (m_currentSessions) {
for (AUTO_VAR(it, m_currentSessions->begin()); for (auto it = m_currentSessions->begin();
it < m_currentSessions->end(); ++it) { it < m_currentSessions->end(); ++it) {
delete (*it); delete (*it);
} }
@ -641,7 +641,7 @@ void UIScene_LoadOrJoinMenu::AddDefaultButtons() {
int i = 0; int i = 0;
for (AUTO_VAR(it, app.getLevelGenerators()->begin()); for (auto it = app.getLevelGenerators()->begin();
it != app.getLevelGenerators()->end(); ++it) { it != app.getLevelGenerators()->end(); ++it) {
LevelGenerationOptions* levelGen = *it; LevelGenerationOptions* levelGen = *it;
@ -1176,7 +1176,7 @@ void UIScene_LoadOrJoinMenu::UpdateGamesList() {
unsigned int sessionIndex = 0; unsigned int sessionIndex = 0;
m_buttonListGames.setCurrentSelection(0); m_buttonListGames.setCurrentSelection(0);
for (AUTO_VAR(it, m_currentSessions->begin()); for (auto it = m_currentSessions->begin();
it < m_currentSessions->end(); ++it) { it < m_currentSessions->end(); ++it) {
FriendSessionInfo* sessionInfo = *it; FriendSessionInfo* sessionInfo = *it;

View file

@ -1142,7 +1142,7 @@ SIZE_T WINAPI XMemSize(PVOID pAddress, DWORD dwAllocAttributes) {
void DumpMem() { void DumpMem() {
int totalLeak = 0; int totalLeak = 0;
for (AUTO_VAR(it, allocCounts.begin()); it != allocCounts.end(); it++) { for (auto it = allocCounts.begin(); it != allocCounts.end(); it++) {
if (it->second > 0) { if (it->second > 0) {
app.DebugPrintf("%d %d %d %d\n", (it->first >> 26) & 0x3f, app.DebugPrintf("%d %d %d %d\n", (it->first >> 26) & 0x3f,
it->first & 0x03ffffff, it->second, it->first & 0x03ffffff, it->second,
@ -1184,7 +1184,7 @@ void MemPixStuff() {
int totals[MAX_SECT] = {0}; int totals[MAX_SECT] = {0};
for (AUTO_VAR(it, allocCounts.begin()); it != allocCounts.end(); it++) { for (auto it = allocCounts.begin(); it != allocCounts.end(); it++) {
if (it->second > 0) { if (it->second > 0) {
int sect = (it->first >> 26) & 0x3f; int sect = (it->first >> 26) & 0x3f;
int bytes = it->first & 0x03ffffff; int bytes = it->first & 0x03ffffff;

View file

@ -1028,7 +1028,7 @@ SIZE_T WINAPI XMemSize(PVOID pAddress, DWORD dwAllocAttributes) {
void DumpMem() { void DumpMem() {
int totalLeak = 0; int totalLeak = 0;
for (AUTO_VAR(it, allocCounts.begin()); it != allocCounts.end(); it++) { for (auto it = allocCounts.begin(); it != allocCounts.end(); it++) {
if (it->second > 0) { if (it->second > 0) {
app.DebugPrintf("%d %d %d %d\n", (it->first >> 26) & 0x3f, app.DebugPrintf("%d %d %d %d\n", (it->first >> 26) & 0x3f,
it->first & 0x03ffffff, it->second, it->first & 0x03ffffff, it->second,
@ -1070,7 +1070,7 @@ void MemPixStuff() {
int totals[MAX_SECT] = {0}; int totals[MAX_SECT] = {0};
for (AUTO_VAR(it, allocCounts.begin()); it != allocCounts.end(); it++) { for (auto it = allocCounts.begin(); it != allocCounts.end(); it++) {
if (it->second > 0) { if (it->second > 0) {
int sect = (it->first >> 26) & 0x3f; int sect = (it->first >> 26) & 0x3f;
int bytes = it->first & 0x03ffffff; int bytes = it->first & 0x03ffffff;

View file

@ -14,7 +14,6 @@
// use - #pragma message(__LOC__"Need to do something here") // use - #pragma message(__LOC__"Need to do something here")
#define AUTO_VAR(_var, _val) auto _var = _val
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unordered_map> #include <unordered_map>

View file

@ -30,7 +30,7 @@ void EntityTracker::addEntity(std::shared_ptr<Entity> e) {
addEntity(e, 32 * 16, 2); addEntity(e, 32 * 16, 2);
std::shared_ptr<ServerPlayer> player = std::shared_ptr<ServerPlayer> player =
std::dynamic_pointer_cast<ServerPlayer>(e); std::dynamic_pointer_cast<ServerPlayer>(e);
for (AUTO_VAR(it, entities.begin()); it != entities.end(); it++) { for (auto it = entities.begin(); it != entities.end(); it++) {
if ((*it)->e != player) { if ((*it)->e != player) {
(*it)->updatePlayer(this, player); (*it)->updatePlayer(this, player);
} }
@ -115,7 +115,7 @@ void EntityTracker::addEntity(std::shared_ptr<Entity> e, int range,
// to allow us to now choose to remove the player as a "seenBy" only when the // to allow us to now choose to remove the player as a "seenBy" only when the
// player has actually been removed from the level's own player array // player has actually been removed from the level's own player array
void EntityTracker::removeEntity(std::shared_ptr<Entity> e) { void EntityTracker::removeEntity(std::shared_ptr<Entity> e) {
AUTO_VAR(it, entityMap.find(e->entityId)); auto it = entityMap.find(e->entityId);
if (it != entityMap.end()) { if (it != entityMap.end()) {
std::shared_ptr<TrackedEntity> te = it->second; std::shared_ptr<TrackedEntity> te = it->second;
entityMap.erase(it); entityMap.erase(it);
@ -128,7 +128,7 @@ void EntityTracker::removePlayer(std::shared_ptr<Entity> e) {
if (e->GetType() == eTYPE_SERVERPLAYER) { if (e->GetType() == eTYPE_SERVERPLAYER) {
std::shared_ptr<ServerPlayer> player = std::shared_ptr<ServerPlayer> player =
std::dynamic_pointer_cast<ServerPlayer>(e); std::dynamic_pointer_cast<ServerPlayer>(e);
for (AUTO_VAR(it, entities.begin()); it != entities.end(); it++) { for (auto it = entities.begin(); it != entities.end(); it++) {
(*it)->removePlayer(player); (*it)->removePlayer(player);
} }
@ -140,7 +140,7 @@ void EntityTracker::removePlayer(std::shared_ptr<Entity> e) {
void EntityTracker::tick() { void EntityTracker::tick() {
std::vector<std::shared_ptr<ServerPlayer> > movedPlayers; std::vector<std::shared_ptr<ServerPlayer> > movedPlayers;
for (AUTO_VAR(it, entities.begin()); it != entities.end(); it++) { for (auto it = entities.begin(); it != entities.end(); it++) {
std::shared_ptr<TrackedEntity> te = *it; std::shared_ptr<TrackedEntity> te = *it;
te->tick(this, &level->players); te->tick(this, &level->players);
if (te->moved && te->e->GetType() == eTYPE_SERVERPLAYER) { if (te->moved && te->e->GetType() == eTYPE_SERVERPLAYER) {
@ -182,7 +182,7 @@ void EntityTracker::tick() {
for (unsigned int i = 0; i < movedPlayers.size(); i++) { for (unsigned int i = 0; i < movedPlayers.size(); i++) {
std::shared_ptr<ServerPlayer> player = movedPlayers[i]; std::shared_ptr<ServerPlayer> player = movedPlayers[i];
if (player->connection == NULL) continue; if (player->connection == NULL) continue;
for (AUTO_VAR(it, entities.begin()); it != entities.end(); it++) { for (auto it = entities.begin(); it != entities.end(); it++) {
std::shared_ptr<TrackedEntity> te = *it; std::shared_ptr<TrackedEntity> te = *it;
if (te->e != player) { if (te->e != player) {
te->updatePlayer(this, player); te->updatePlayer(this, player);
@ -191,7 +191,7 @@ void EntityTracker::tick() {
} }
// 4J Stu - We want to do this for dead players as they don't tick normally // 4J Stu - We want to do this for dead players as they don't tick normally
for (AUTO_VAR(it, level->players.begin()); it != level->players.end(); for (auto it = level->players.begin(); it != level->players.end();
++it) { ++it) {
std::shared_ptr<ServerPlayer> player = std::shared_ptr<ServerPlayer> player =
std::dynamic_pointer_cast<ServerPlayer>(*it); std::dynamic_pointer_cast<ServerPlayer>(*it);
@ -203,7 +203,7 @@ void EntityTracker::tick() {
void EntityTracker::broadcast(std::shared_ptr<Entity> e, void EntityTracker::broadcast(std::shared_ptr<Entity> e,
std::shared_ptr<Packet> packet) { std::shared_ptr<Packet> packet) {
AUTO_VAR(it, entityMap.find(e->entityId)); auto it = entityMap.find(e->entityId);
if (it != entityMap.end()) { if (it != entityMap.end()) {
std::shared_ptr<TrackedEntity> te = it->second; std::shared_ptr<TrackedEntity> te = it->second;
te->broadcast(packet); te->broadcast(packet);
@ -212,7 +212,7 @@ void EntityTracker::broadcast(std::shared_ptr<Entity> e,
void EntityTracker::broadcastAndSend(std::shared_ptr<Entity> e, void EntityTracker::broadcastAndSend(std::shared_ptr<Entity> e,
std::shared_ptr<Packet> packet) { std::shared_ptr<Packet> packet) {
AUTO_VAR(it, entityMap.find(e->entityId)); auto it = entityMap.find(e->entityId);
if (it != entityMap.end()) { if (it != entityMap.end()) {
std::shared_ptr<TrackedEntity> te = it->second; std::shared_ptr<TrackedEntity> te = it->second;
te->broadcastAndSend(packet); te->broadcastAndSend(packet);
@ -220,7 +220,7 @@ void EntityTracker::broadcastAndSend(std::shared_ptr<Entity> e,
} }
void EntityTracker::clear(std::shared_ptr<ServerPlayer> serverPlayer) { void EntityTracker::clear(std::shared_ptr<ServerPlayer> serverPlayer) {
for (AUTO_VAR(it, entities.begin()); it != entities.end(); it++) { for (auto it = entities.begin(); it != entities.end(); it++) {
std::shared_ptr<TrackedEntity> te = *it; std::shared_ptr<TrackedEntity> te = *it;
te->clear(serverPlayer); te->clear(serverPlayer);
} }
@ -228,7 +228,7 @@ void EntityTracker::clear(std::shared_ptr<ServerPlayer> serverPlayer) {
void EntityTracker::playerLoadedChunk(std::shared_ptr<ServerPlayer> player, void EntityTracker::playerLoadedChunk(std::shared_ptr<ServerPlayer> player,
LevelChunk* chunk) { LevelChunk* chunk) {
for (AUTO_VAR(it, entities.begin()); it != entities.end(); ++it) { for (auto it = entities.begin(); it != entities.end(); ++it) {
std::shared_ptr<TrackedEntity> te = *it; std::shared_ptr<TrackedEntity> te = *it;
if (te->e != player && te->e->xChunk == chunk->x && if (te->e != player && te->e->xChunk == chunk->x &&
te->e->zChunk == chunk->z) { te->e->zChunk == chunk->z) {
@ -244,7 +244,7 @@ void EntityTracker::updateMaxRange() {
std::shared_ptr<TrackedEntity> EntityTracker::getTracker( std::shared_ptr<TrackedEntity> EntityTracker::getTracker(
std::shared_ptr<Entity> e) { std::shared_ptr<Entity> e) {
AUTO_VAR(it, entityMap.find(e->entityId)); auto it = entityMap.find(e->entityId);
if (it != entityMap.end()) { if (it != entityMap.end()) {
return it->second; return it->second;
} }

View file

@ -153,8 +153,8 @@ void ServerPlayer::flagEntitiesToBeRemoved(unsigned int* flags,
memset(flags, 0, 2048 / 32); memset(flags, 0, 2048 / 32);
} }
AUTO_VAR(it, entitiesToRemove.begin()); auto it = entitiesToRemove.begin();
for (AUTO_VAR(it, entitiesToRemove.begin()); it != entitiesToRemove.end(); for (auto it = entitiesToRemove.begin(); it != entitiesToRemove.end();
it++) { it++) {
int index = *it; int index = *it;
if (index < 2048) { if (index < 2048) {
@ -259,7 +259,7 @@ void ServerPlayer::flushEntitiesToRemove() {
intArray ids(amount); intArray ids(amount);
int pos = 0; int pos = 0;
AUTO_VAR(it, entitiesToRemove.begin()); auto it = entitiesToRemove.begin();
while (it != entitiesToRemove.end() && pos < amount) { while (it != entitiesToRemove.end() && pos < amount) {
ids[pos++] = *it; ids[pos++] = *it;
it = entitiesToRemove.erase(it); it = entitiesToRemove.erase(it);
@ -331,7 +331,7 @@ void ServerPlayer::doChunkSendingTick(bool dontDelayChunks) {
// the spiral of chunks that that method creates, long before // the spiral of chunks that that method creates, long before
// transmission of them is complete. // transmission of them is complete.
double dist = DBL_MAX; double dist = DBL_MAX;
for (AUTO_VAR(it, chunksToSend.begin()); it != chunksToSend.end(); for (auto it = chunksToSend.begin(); it != chunksToSend.end();
it++) { it++) {
ChunkPos chunk = *it; ChunkPos chunk = *it;
if (level->isChunkFinalised(chunk.x, chunk.z)) { if (level->isChunkFinalised(chunk.x, chunk.z)) {
@ -572,7 +572,7 @@ void ServerPlayer::doTickB() {
players.push_back( players.push_back(
std::dynamic_pointer_cast<Player>(shared_from_this())); std::dynamic_pointer_cast<Player>(shared_from_this()));
for (AUTO_VAR(it, objectives->begin()); it != objectives->end(); for (auto it = objectives->begin(); it != objectives->end();
++it) { ++it) {
Objective* objective = *it; Objective* objective = *it;
getScoreboard() getScoreboard()
@ -806,9 +806,9 @@ void ServerPlayer::changeDimension(int i) {
thisPlayer->GetUserIndex()); thisPlayer->GetUserIndex());
} }
if (thisPlayer != NULL) { if (thisPlayer != NULL) {
for (AUTO_VAR(it, MinecraftServer::getInstance() for (auto it = MinecraftServer::getInstance()
->getPlayers() ->getPlayers()
->players.begin()); ->players.begin();
it != it !=
MinecraftServer::getInstance()->getPlayers()->players.end(); MinecraftServer::getInstance()->getPlayers()->players.end();
++it) { ++it) {

View file

@ -80,7 +80,7 @@ void TrackedEntity::tick(EntityTracker* tracker,
!e->removed) { !e->removed) {
std::shared_ptr<MapItemSavedData> data = std::shared_ptr<MapItemSavedData> data =
Item::map->getSavedData(item, e->level); Item::map->getSavedData(item, e->level);
for (AUTO_VAR(it, players->begin()); it != players->end(); ++it) { for (auto it = players->begin(); it != players->end(); ++it) {
std::shared_ptr<ServerPlayer> player = std::shared_ptr<ServerPlayer> player =
std::dynamic_pointer_cast<ServerPlayer>(*it); std::dynamic_pointer_cast<ServerPlayer>(*it);
data->tickCarriedBy(player, item); data->tickCarriedBy(player, item);
@ -378,7 +378,7 @@ void TrackedEntity::broadcast(std::shared_ptr<Packet> packet) {
// can be sent to any player, but we try to restrict the network impact // can be sent to any player, but we try to restrict the network impact
// this has by not resending to the one machine // this has by not resending to the one machine
for (AUTO_VAR(it, seenBy.begin()); it != seenBy.end(); it++) { for (auto it = seenBy.begin(); it != seenBy.end(); it++) {
std::shared_ptr<ServerPlayer> player = *it; std::shared_ptr<ServerPlayer> player = *it;
bool dontSend = false; bool dontSend = false;
if (sentTo.size()) { if (sentTo.size()) {
@ -422,7 +422,7 @@ void TrackedEntity::broadcast(std::shared_ptr<Packet> packet) {
// This packet hasn't got canSendToAnyClient set, so just send to // This packet hasn't got canSendToAnyClient set, so just send to
// everyone here, and it // everyone here, and it
for (AUTO_VAR(it, seenBy.begin()); it != seenBy.end(); it++) { for (auto it = seenBy.begin(); it != seenBy.end(); it++) {
(*it)->connection->send(packet); (*it)->connection->send(packet);
} }
} }
@ -441,13 +441,13 @@ void TrackedEntity::broadcastAndSend(std::shared_ptr<Packet> packet) {
} }
void TrackedEntity::broadcastRemoved() { void TrackedEntity::broadcastRemoved() {
for (AUTO_VAR(it, seenBy.begin()); it != seenBy.end(); it++) { for (auto it = seenBy.begin(); it != seenBy.end(); it++) {
(*it)->entitiesToRemove.push_back(e->entityId); (*it)->entitiesToRemove.push_back(e->entityId);
} }
} }
void TrackedEntity::removePlayer(std::shared_ptr<ServerPlayer> sp) { void TrackedEntity::removePlayer(std::shared_ptr<ServerPlayer> sp) {
AUTO_VAR(it, seenBy.find(sp)); auto it = seenBy.find(sp);
if (it != seenBy.end()) { if (it != seenBy.end()) {
sp->entitiesToRemove.push_back(e->entityId); sp->entitiesToRemove.push_back(e->entityId);
seenBy.erase(it); seenBy.erase(it);
@ -635,7 +635,7 @@ void TrackedEntity::updatePlayer(EntityTracker* tracker,
std::dynamic_pointer_cast<LivingEntity>(e); std::dynamic_pointer_cast<LivingEntity>(e);
std::vector<MobEffectInstance*>* activeEffects = std::vector<MobEffectInstance*>* activeEffects =
mob->getActiveEffects(); mob->getActiveEffects();
for (AUTO_VAR(it, activeEffects->begin()); for (auto it = activeEffects->begin();
it != activeEffects->end(); ++it) { it != activeEffects->end(); ++it) {
MobEffectInstance* effect = *it; MobEffectInstance* effect = *it;
@ -645,7 +645,7 @@ void TrackedEntity::updatePlayer(EntityTracker* tracker,
delete activeEffects; delete activeEffects;
} }
} else if (visibility == eVisibility_NotVisible) { } else if (visibility == eVisibility_NotVisible) {
AUTO_VAR(it, seenBy.find(sp)); auto it = seenBy.find(sp);
if (it != seenBy.end()) { if (it != seenBy.end()) {
seenBy.erase(it); seenBy.erase(it);
sp->entitiesToRemove.push_back(e->entityId); sp->entitiesToRemove.push_back(e->entityId);
@ -838,7 +838,7 @@ std::shared_ptr<Packet> TrackedEntity::getAddEntityPacket() {
} }
void TrackedEntity::clear(std::shared_ptr<ServerPlayer> sp) { void TrackedEntity::clear(std::shared_ptr<ServerPlayer> sp) {
AUTO_VAR(it, seenBy.find(sp)); auto it = seenBy.find(sp);
if (it != seenBy.end()) { if (it != seenBy.end()) {
seenBy.erase(it); seenBy.erase(it);
sp->entitiesToRemove.push_back(e->entityId); sp->entitiesToRemove.push_back(e->entityId);

View file

@ -33,7 +33,7 @@ void Chunk::reconcileRenderableTileEntities(
const std::vector<std::shared_ptr<TileEntity> >& renderableTileEntities) { const std::vector<std::shared_ptr<TileEntity> >& renderableTileEntities) {
int key = int key =
levelRenderer->getGlobalIndexForChunk(this->x, this->y, this->z, level); levelRenderer->getGlobalIndexForChunk(this->x, this->y, this->z, level);
AUTO_VAR(it, globalRenderableTileEntities->find(key)); auto it = globalRenderableTileEntities->find(key);
if (!renderableTileEntities.empty()) { if (!renderableTileEntities.empty()) {
std::unordered_set<TileEntity*> currentRenderableTileEntitySet; std::unordered_set<TileEntity*> currentRenderableTileEntitySet;
currentRenderableTileEntitySet.reserve(renderableTileEntities.size()); currentRenderableTileEntitySet.reserve(renderableTileEntities.size());
@ -45,7 +45,7 @@ void Chunk::reconcileRenderableTileEntities(
LevelRenderer::RenderableTileEntityBucket& existingBucket = LevelRenderer::RenderableTileEntityBucket& existingBucket =
it->second; it->second;
for (AUTO_VAR(it2, existingBucket.tiles.begin()); for (auto it2 = existingBucket.tiles.begin();
it2 != existingBucket.tiles.end(); it2++) { it2 != existingBucket.tiles.end(); it2++) {
TileEntity* tileEntity = (*it2).get(); TileEntity* tileEntity = (*it2).get();
if (currentRenderableTileEntitySet.find(tileEntity) == if (currentRenderableTileEntitySet.find(tileEntity) ==
@ -78,7 +78,7 @@ void Chunk::reconcileRenderableTileEntities(
} }
} }
} else if (it != globalRenderableTileEntities->end()) { } else if (it != globalRenderableTileEntities->end()) {
for (AUTO_VAR(it2, it->second.tiles.begin()); for (auto it2 = it->second.tiles.begin();
it2 != it->second.tiles.end(); it2 != it->second.tiles.end();
it2++) { it2++) {
(*it2)->setRenderRemoveStage( (*it2)->setRenderRemoveStage(

View file

@ -176,7 +176,7 @@ EntityRenderDispatcher::EntityRenderDispatcher() {
renderers[eTYPE_LIGHTNINGBOLT] = new LightningBoltRenderer(); renderers[eTYPE_LIGHTNINGBOLT] = new LightningBoltRenderer();
glDisable(GL_LIGHTING); glDisable(GL_LIGHTING);
AUTO_VAR(itEnd, renderers.end()); auto itEnd = renderers.end();
for (classToRendererMap::iterator it = renderers.begin(); it != itEnd; for (classToRendererMap::iterator it = renderers.begin(); it != itEnd;
it++) { it++) {
it->second->init(this); it->second->init(this);
@ -188,7 +188,7 @@ EntityRenderDispatcher::EntityRenderDispatcher() {
EntityRenderer* EntityRenderDispatcher::getRenderer(eINSTANCEOF e) { EntityRenderer* EntityRenderDispatcher::getRenderer(eINSTANCEOF e) {
if ((e & eTYPE_PLAYER) == eTYPE_PLAYER) e = eTYPE_PLAYER; if ((e & eTYPE_PLAYER) == eTYPE_PLAYER) e = eTYPE_PLAYER;
// EntityRenderer * r = renderers[e]; // EntityRenderer * r = renderers[e];
AUTO_VAR(it, renderers.find(e)); // 4J Stu - The .at and [] accessors auto it = renderers.find(e); // 4J Stu - The .at and [] accessors
// insert elements if they don't exist // insert elements if they don't exist
if (it == renderers.end()) { if (it == renderers.end()) {
@ -304,7 +304,7 @@ Font* EntityRenderDispatcher::getFont() { return font; }
void EntityRenderDispatcher::registerTerrainTextures( void EntityRenderDispatcher::registerTerrainTextures(
IconRegister* iconRegister) { IconRegister* iconRegister) {
// for (EntityRenderer<? extends Entity> renderer : renderers.values()) // for (EntityRenderer<? extends Entity> renderer : renderers.values())
for (AUTO_VAR(it, renderers.begin()); it != renderers.end(); ++it) { for (auto it = renderers.begin(); it != renderers.end(); ++it) {
EntityRenderer* renderer = it->second; EntityRenderer* renderer = it->second;
renderer->registerTerrainTextures(iconRegister); renderer->registerTerrainTextures(iconRegister);
} }

View file

@ -86,7 +86,7 @@ ResourceLocation* HorseRenderer::getOrCreateLayeredTextureLocation(
std::shared_ptr<EntityHorse> horse) { std::shared_ptr<EntityHorse> horse) {
std::wstring textureName = horse->getLayeredTextureHashName(); std::wstring textureName = horse->getLayeredTextureHashName();
AUTO_VAR(it, LAYERED_LOCATION_CACHE.find(textureName)); auto it = LAYERED_LOCATION_CACHE.find(textureName);
ResourceLocation* location; ResourceLocation* location;
if (it != LAYERED_LOCATION_CACHE.end()) { if (it != LAYERED_LOCATION_CACHE.end()) {

View file

@ -199,7 +199,7 @@ void PlayerRenderer::render(std::shared_ptr<Entity> _mob, double x, double y,
mob->GetAdditionalModelParts(); mob->GetAdditionalModelParts();
// turn them on // turn them on
if (pAdditionalModelParts != NULL) { if (pAdditionalModelParts != NULL) {
for (AUTO_VAR(it, pAdditionalModelParts->begin()); for (auto it = pAdditionalModelParts->begin();
it != pAdditionalModelParts->end(); ++it) { it != pAdditionalModelParts->end(); ++it) {
ModelPart* pModelPart = *it; ModelPart* pModelPart = *it;
@ -211,7 +211,7 @@ void PlayerRenderer::render(std::shared_ptr<Entity> _mob, double x, double y,
// turn them off again // turn them off again
if (pAdditionalModelParts && pAdditionalModelParts->size() != 0) { if (pAdditionalModelParts && pAdditionalModelParts->size() != 0) {
for (AUTO_VAR(it, pAdditionalModelParts->begin()); for (auto it = pAdditionalModelParts->begin();
it != pAdditionalModelParts->end(); ++it) { it != pAdditionalModelParts->end(); ++it) {
ModelPart* pModelPart = *it; ModelPart* pModelPart = *it;

View file

@ -48,7 +48,7 @@ TileEntityRenderDispatcher::TileEntityRenderDispatcher() {
renderers[eTYPE_BEACONTILEENTITY] = new BeaconRenderer(); renderers[eTYPE_BEACONTILEENTITY] = new BeaconRenderer();
glDisable(GL_LIGHTING); glDisable(GL_LIGHTING);
AUTO_VAR(itEnd, renderers.end()); auto itEnd = renderers.end();
for (classToTileRendererMap::iterator it = renderers.begin(); it != itEnd; for (classToTileRendererMap::iterator it = renderers.begin(); it != itEnd;
it++) { it++) {
if (it->second) it->second->init(this); if (it->second) it->second->init(this);
@ -58,7 +58,7 @@ TileEntityRenderDispatcher::TileEntityRenderDispatcher() {
TileEntityRenderer* TileEntityRenderDispatcher::getRenderer(eINSTANCEOF e) { TileEntityRenderer* TileEntityRenderDispatcher::getRenderer(eINSTANCEOF e) {
TileEntityRenderer* r = NULL; TileEntityRenderer* r = NULL;
// TileEntityRenderer *r = renderers[e]; // TileEntityRenderer *r = renderers[e];
AUTO_VAR(it, renderers.find(e)); // 4J Stu - The .at and [] accessors auto it = renderers.find(e); // 4J Stu - The .at and [] accessors
// insert elements if they don't exist // insert elements if they don't exist
if (it == renderers.end()) { if (it == renderers.end()) {
@ -143,7 +143,7 @@ void TileEntityRenderDispatcher::render(std::shared_ptr<TileEntity> entity,
void TileEntityRenderDispatcher::setLevel(Level* level) { void TileEntityRenderDispatcher::setLevel(Level* level) {
this->level = level; this->level = level;
for (AUTO_VAR(it, renderers.begin()); it != renderers.end(); it++) { for (auto it = renderers.begin(); it != renderers.end(); it++) {
if (it->second) it->second->onNewLevel(level); if (it->second) it->second->onNewLevel(level);
} }
} }

View file

@ -310,8 +310,8 @@ void GameRenderer::pick(float a) {
mc->level->getEntities(mc->cameraTargetPlayer, &grown); mc->level->getEntities(mc->cameraTargetPlayer, &grown);
double nearest = dist; double nearest = dist;
AUTO_VAR(itEnd, objects->end()); auto itEnd = objects->end();
for (AUTO_VAR(it, objects->begin()); it != itEnd; it++) { for (auto it = objects->begin(); it != itEnd; it++) {
std::shared_ptr<Entity> e = *it; // objects->at(i); std::shared_ptr<Entity> e = *it; // objects->at(i);
if (!e->isPickable()) continue; if (!e->isPickable()) continue;

View file

@ -564,8 +564,8 @@ void LevelRenderer::renderEntities(Vec3* cam, Culler* culler, float a) {
level[playerIndex]->getAllEntities(); level[playerIndex]->getAllEntities();
totalEntities = (int)entities.size(); totalEntities = (int)entities.size();
AUTO_VAR(itEndGE, level[playerIndex]->globalEntities.end()); auto itEndGE = level[playerIndex]->globalEntities.end();
for (AUTO_VAR(it, level[playerIndex]->globalEntities.begin()); for (auto it = level[playerIndex]->globalEntities.begin();
it != itEndGE; it++) { it != itEndGE; it++) {
std::shared_ptr<Entity> entity = *it; // level->globalEntities[i]; std::shared_ptr<Entity> entity = *it; // level->globalEntities[i];
renderedEntities++; renderedEntities++;
@ -573,8 +573,8 @@ void LevelRenderer::renderEntities(Vec3* cam, Culler* culler, float a) {
EntityRenderDispatcher::instance->render(entity, a); EntityRenderDispatcher::instance->render(entity, a);
} }
AUTO_VAR(itEndEnts, entities.end()); auto itEndEnts = entities.end();
for (AUTO_VAR(it, entities.begin()); it != itEndEnts; it++) { for (auto it = entities.begin(); it != itEndEnts; it++) {
std::shared_ptr<Entity> entity = *it; // entities[i]; std::shared_ptr<Entity> entity = *it; // entities[i];
bool shouldRender = bool shouldRender =
@ -620,13 +620,13 @@ void LevelRenderer::renderEntities(Vec3* cam, Culler* culler, float a) {
// hashmap by chunk/dimension index. The index is calculated in the same way // hashmap by chunk/dimension index. The index is calculated in the same way
// as the global flags. // as the global flags.
EnterCriticalSection(&m_csRenderableTileEntities); EnterCriticalSection(&m_csRenderableTileEntities);
for (AUTO_VAR(it, renderableTileEntities.begin()); for (auto it = renderableTileEntities.begin();
it != renderableTileEntities.end(); it++) { it != renderableTileEntities.end(); it++) {
int idx = it->first; int idx = it->first;
// Don't render if it isn't in the same dimension as this player // Don't render if it isn't in the same dimension as this player
if (!isGlobalIndexInSameDimension(idx, level[playerIndex])) continue; if (!isGlobalIndexInSameDimension(idx, level[playerIndex])) continue;
for (AUTO_VAR(it2, it->second.tiles.begin()); for (auto it2 = it->second.tiles.begin();
it2 != it->second.tiles.end(); it2++) { it2 != it->second.tiles.end(); it2++) {
TileEntityRenderDispatcher::instance->render(*it2, a); TileEntityRenderDispatcher::instance->render(*it2, a);
} }
@ -854,7 +854,7 @@ void LevelRenderer::tick() {
ticks++; ticks++;
if ((ticks % SharedConstants::TICKS_PER_SECOND) == 0) { if ((ticks % SharedConstants::TICKS_PER_SECOND) == 0) {
AUTO_VAR(it, destroyingBlocks.begin()); auto it = destroyingBlocks.begin();
while (it != destroyingBlocks.end()) { while (it != destroyingBlocks.end()) {
BlockDestructionProgress* block = it->second; BlockDestructionProgress* block = it->second;
@ -2153,7 +2153,7 @@ void LevelRenderer::renderDestroyAnimation(Tesselator* t,
t->offset((float)-xo, (float)-yo, (float)-zo); t->offset((float)-xo, (float)-yo, (float)-zo);
t->noColor(); t->noColor();
AUTO_VAR(it, destroyingBlocks.begin()); auto it = destroyingBlocks.begin();
while (it != destroyingBlocks.end()) { while (it != destroyingBlocks.end()) {
BlockDestructionProgress* block = it->second; BlockDestructionProgress* block = it->second;
double xd = block->getX() - xo; double xd = block->getX() - xo;
@ -3578,7 +3578,7 @@ void LevelRenderer::levelEvent(std::shared_ptr<Player> source, int type, int x,
void LevelRenderer::destroyTileProgress(int id, int x, int y, int z, void LevelRenderer::destroyTileProgress(int id, int x, int y, int z,
int progress) { int progress) {
if (progress < 0 || progress >= 10) { if (progress < 0 || progress >= 10) {
AUTO_VAR(it, destroyingBlocks.find(id)); auto it = destroyingBlocks.find(id);
if (it != destroyingBlocks.end()) { if (it != destroyingBlocks.end()) {
delete it->second; delete it->second;
destroyingBlocks.erase(it); destroyingBlocks.erase(it);
@ -3587,7 +3587,7 @@ void LevelRenderer::destroyTileProgress(int id, int x, int y, int z,
} else { } else {
BlockDestructionProgress* entry = NULL; BlockDestructionProgress* entry = NULL;
AUTO_VAR(it, destroyingBlocks.find(id)); auto it = destroyingBlocks.find(id);
if (it != destroyingBlocks.end()) entry = it->second; if (it != destroyingBlocks.end()) entry = it->second;
if (entry == NULL || entry->getX() != x || entry->getY() != y || if (entry == NULL || entry->getX() != x || entry->getY() != y ||
@ -3867,7 +3867,7 @@ void LevelRenderer::fullyFlagRenderableTileEntitiesToBeRemoved() {
if (itChunk == renderableTileEntities.end()) continue; if (itChunk == renderableTileEntities.end()) continue;
RenderableTileEntityBucket& bucket = itChunk->second; RenderableTileEntityBucket& bucket = itChunk->second;
for (AUTO_VAR(itPending, itKey->second.begin()); for (auto itPending = itKey->second.begin();
itPending != itKey->second.end(); itPending++) { itPending != itKey->second.end(); itPending++) {
if (bucket.indexByTile.find(*itPending) == if (bucket.indexByTile.find(*itPending) ==
bucket.indexByTile.end()) { bucket.indexByTile.end()) {

View file

@ -122,7 +122,7 @@ void Minimap::render(std::shared_ptr<Player> player, Textures* textures,
textures->bind( textures->bind(
textures->loadTexture(TN_MISC_MAPICONS)); // L"/misc/mapicons.png")); textures->loadTexture(TN_MISC_MAPICONS)); // L"/misc/mapicons.png"));
AUTO_VAR(itEnd, data->decorations.end()); auto itEnd = data->decorations.end();
#if defined(_LARGE_WORLDS) #if defined(_LARGE_WORLDS)
std::vector<MapItemSavedData::MapDecoration*> m_edgeIcons; std::vector<MapItemSavedData::MapDecoration*> m_edgeIcons;
@ -188,7 +188,7 @@ void Minimap::render(std::shared_ptr<Player> player, Textures* textures,
textures->bind(textures->loadTexture(TN_MISC_ADDITIONALMAPICONS)); textures->bind(textures->loadTexture(TN_MISC_ADDITIONALMAPICONS));
fIconZ = -0.04f; // 4J - moved to -0.04 (was -0.02) to stop z fighting fIconZ = -0.04f; // 4J - moved to -0.04 (was -0.02) to stop z fighting
for (AUTO_VAR(it, m_edgeIcons.begin()); it != m_edgeIcons.end(); it++) { for (auto it = m_edgeIcons.begin(); it != m_edgeIcons.end(); it++) {
MapItemSavedData::MapDecoration* dec = *it; MapItemSavedData::MapDecoration* dec = *it;
char imgIndex = dec->img; char imgIndex = dec->img;

View file

@ -55,10 +55,10 @@ void ModelPart::addChild(ModelPart* child) {
} }
ModelPart* ModelPart::retrieveChild(SKIN_BOX* pBox) { ModelPart* ModelPart::retrieveChild(SKIN_BOX* pBox) {
for (AUTO_VAR(it, children.begin()); it != children.end(); ++it) { for (auto it = children.begin(); it != children.end(); ++it) {
ModelPart* child = *it; ModelPart* child = *it;
for (AUTO_VAR(itcube, child->cubes.begin()); for (auto itcube = child->cubes.begin();
itcube != child->cubes.end(); ++itcube) { itcube != child->cubes.end(); ++itcube) {
Cube* pCube = *itcube; Cube* pCube = *itcube;

View file

@ -261,8 +261,8 @@ void ParticleEngine::moveParticleInList(std::shared_ptr<Particle> particle,
? 0 ? 0
: (particle->level->dimension->id == -1 ? 1 : 2); : (particle->level->dimension->id == -1 ? 1 : 2);
for (int tt = 0; tt < TEXTURE_COUNT; tt++) { for (int tt = 0; tt < TEXTURE_COUNT; tt++) {
AUTO_VAR(it, find(particles[l][tt][source].begin(), auto it = find(particles[l][tt][source].begin(),
particles[l][tt][source].end(), particle)); particles[l][tt][source].end(), particle);
if (it != particles[l][tt][source].end()) { if (it != particles[l][tt][source].end()) {
(*it) = particles[l][tt][source].back(); (*it) = particles[l][tt][source].back();
particles[l][tt][source].pop_back(); particles[l][tt][source].pop_back();

View file

@ -125,7 +125,7 @@ TexturePackRepository::getTexturePackIdNames() {
std::vector<std::pair<std::uint32_t, std::wstring> >* packList = std::vector<std::pair<std::uint32_t, std::wstring> >* packList =
new std::vector<std::pair<std::uint32_t, std::wstring> >(); new std::vector<std::pair<std::uint32_t, std::wstring> >();
for (AUTO_VAR(it, texturePacks->begin()); it != texturePacks->end(); ++it) { for (auto it = texturePacks->begin(); it != texturePacks->end(); ++it) {
TexturePack* pack = *it; TexturePack* pack = *it;
packList->push_back(std::pair<std::uint32_t, std::wstring>( packList->push_back(std::pair<std::uint32_t, std::wstring>(
pack->getId(), pack->getName())); pack->getId(), pack->getName()));
@ -142,7 +142,7 @@ bool TexturePackRepository::selectTexturePackById(std::uint32_t id) {
// pack is installed // pack is installed
app.SetRequiredTexturePackID(id); app.SetRequiredTexturePackID(id);
AUTO_VAR(it, cacheById.find(id)); auto it = cacheById.find(id);
if (it != cacheById.end()) { if (it != cacheById.end()) {
TexturePack* newPack = it->second; TexturePack* newPack = it->second;
if (newPack != selected) { if (newPack != selected) {
@ -177,7 +177,7 @@ bool TexturePackRepository::selectTexturePackById(std::uint32_t id) {
} }
TexturePack* TexturePackRepository::getTexturePackById(std::uint32_t id) { TexturePack* TexturePackRepository::getTexturePackById(std::uint32_t id) {
AUTO_VAR(it, cacheById.find(id)); auto it = cacheById.find(id);
if (it != cacheById.end()) { if (it != cacheById.end()) {
return it->second; return it->second;
} }
@ -213,19 +213,19 @@ TexturePack* TexturePackRepository::addTexturePackFromDLC(DLCPack* dlcPack,
} }
void TexturePackRepository::clearInvalidTexturePacks() { void TexturePackRepository::clearInvalidTexturePacks() {
for (AUTO_VAR(it, m_texturePacksToDelete.begin()); for (auto it = m_texturePacksToDelete.begin();
it != m_texturePacksToDelete.end(); ++it) { it != m_texturePacksToDelete.end(); ++it) {
delete *it; delete *it;
} }
} }
void TexturePackRepository::removeTexturePackById(std::uint32_t id) { void TexturePackRepository::removeTexturePackById(std::uint32_t id) {
AUTO_VAR(it, cacheById.find(id)); auto it = cacheById.find(id);
if (it != cacheById.end()) { if (it != cacheById.end()) {
TexturePack* oldPack = it->second; TexturePack* oldPack = it->second;
AUTO_VAR(it2, auto it2 =
find(texturePacks->begin(), texturePacks->end(), oldPack)); find(texturePacks->begin(), texturePacks->end(), oldPack);
if (it2 != texturePacks->end()) { if (it2 != texturePacks->end()) {
texturePacks->erase(it2); texturePacks->erase(it2);
if (lastSelected == oldPack) { if (lastSelected == oldPack) {
@ -264,7 +264,7 @@ TexturePack* TexturePackRepository::getTexturePackByIndex(unsigned int index) {
unsigned int TexturePackRepository::getTexturePackIndex(std::uint32_t id) { unsigned int TexturePackRepository::getTexturePackIndex(std::uint32_t id) {
int currentIndex = 0; int currentIndex = 0;
for (AUTO_VAR(it, texturePacks->begin()); it != texturePacks->end(); ++it) { for (auto it = texturePacks->begin(); it != texturePacks->end(); ++it) {
TexturePack* pack = *it; TexturePack* pack = *it;
if (pack->getId() == id) break; if (pack->getId() == id) break;
++currentIndex; ++currentIndex;

View file

@ -40,7 +40,7 @@ PreStitchedTextureMap::PreStitchedTextureMap(int type, const std::wstring& name,
void PreStitchedTextureMap::stitch() { void PreStitchedTextureMap::stitch() {
// Animated StitchedTextures store a vector of textures for each frame of // Animated StitchedTextures store a vector of textures for each frame of
// the animation. Free any pre-existing ones here. // the animation. Free any pre-existing ones here.
for (AUTO_VAR(it, animatedTextures.begin()); it != animatedTextures.end(); for (auto it = animatedTextures.begin(); it != animatedTextures.end();
++it) { ++it) {
StitchedTexture* animatedStitchedTexture = *it; StitchedTexture* animatedStitchedTexture = *it;
animatedStitchedTexture->freeFrameTextures(); animatedStitchedTexture->freeFrameTextures();
@ -119,7 +119,7 @@ void PreStitchedTextureMap::stitch() {
TextureManager::getInstance()->registerName(name, stitchResult); TextureManager::getInstance()->registerName(name, stitchResult);
// stitchResult = stitcher->constructTexture(m_mipMap); // stitchResult = stitcher->constructTexture(m_mipMap);
for (AUTO_VAR(it, texturesByName.begin()); it != texturesByName.end(); for (auto it = texturesByName.begin(); it != texturesByName.end();
++it) { ++it) {
StitchedTexture* preStitched = (StitchedTexture*)it->second; StitchedTexture* preStitched = (StitchedTexture*)it->second;
@ -132,7 +132,7 @@ void PreStitchedTextureMap::stitch() {
} }
MemSect(52); MemSect(52);
for (AUTO_VAR(it, texturesByName.begin()); it != texturesByName.end(); for (auto it = texturesByName.begin(); it != texturesByName.end();
++it) { ++it) {
StitchedTexture* preStitched = (StitchedTexture*)(it->second); StitchedTexture* preStitched = (StitchedTexture*)(it->second);
@ -204,7 +204,7 @@ StitchedTexture* PreStitchedTextureMap::getTexture(const std::wstring& name) {
void PreStitchedTextureMap::cycleAnimationFrames() { void PreStitchedTextureMap::cycleAnimationFrames() {
// for (StitchedTexture texture : animatedTextures) // for (StitchedTexture texture : animatedTextures)
for (AUTO_VAR(it, animatedTextures.begin()); it != animatedTextures.end(); for (auto it = animatedTextures.begin(); it != animatedTextures.end();
++it) { ++it) {
StitchedTexture* texture = *it; StitchedTexture* texture = *it;
texture->cycleFrames(); texture->cycleFrames();
@ -225,7 +225,7 @@ Icon* PreStitchedTextureMap::registerIcon(const std::wstring& name) {
// new RuntimeException("Don't register null!").printStackTrace(); // new RuntimeException("Don't register null!").printStackTrace();
} }
AUTO_VAR(it, texturesByName.find(name)); auto it = texturesByName.find(name);
if (it != texturesByName.end()) result = it->second; if (it != texturesByName.end()) result = it->second;
if (result == NULL) { if (result == NULL) {
@ -265,7 +265,7 @@ void PreStitchedTextureMap::loadUVs() {
return; return;
} }
for (AUTO_VAR(it, texturesByName.begin()); it != texturesByName.end(); for (auto it = texturesByName.begin(); it != texturesByName.end();
++it) { ++it) {
delete it->second; delete it->second;
} }

View file

@ -109,7 +109,7 @@ bool StitchSlot::add(TextureHolder* textureHolder) {
} }
// for (final StitchSlot subSlot : subSlots) // for (final StitchSlot subSlot : subSlots)
for (AUTO_VAR(it, subSlots->begin()); it != subSlots->end(); ++it) { for (auto it = subSlots->begin(); it != subSlots->end(); ++it) {
StitchSlot* subSlot = *it; StitchSlot* subSlot = *it;
if (subSlot->add(textureHolder)) { if (subSlot->add(textureHolder)) {
return true; return true;
@ -124,7 +124,7 @@ void StitchSlot::collectAssignments(std::vector<StitchSlot*>* result) {
result->push_back(this); result->push_back(this);
} else if (subSlots != NULL) { } else if (subSlots != NULL) {
// for (StitchSlot subSlot : subSlots) // for (StitchSlot subSlot : subSlots)
for (AUTO_VAR(it, subSlots->begin()); it != subSlots->end(); ++it) { for (auto it = subSlots->begin(); it != subSlots->end(); ++it) {
StitchSlot* subSlot = *it; StitchSlot* subSlot = *it;
subSlot->collectAssignments(result); subSlot->collectAssignments(result);
} }

View file

@ -43,7 +43,7 @@ StitchedTexture::StitchedTexture(const std::wstring& name,
void StitchedTexture::freeFrameTextures() { void StitchedTexture::freeFrameTextures() {
if (frames != NULL) { if (frames != NULL) {
for (AUTO_VAR(it, frames->begin()); it != frames->end(); ++it) { for (auto it = frames->begin(); it != frames->end(); ++it) {
TextureManager::getInstance()->unregisterTexture(L"", *it); TextureManager::getInstance()->unregisterTexture(L"", *it);
delete *it; delete *it;
} }
@ -54,7 +54,7 @@ void StitchedTexture::freeFrameTextures() {
StitchedTexture::~StitchedTexture() { StitchedTexture::~StitchedTexture() {
if (frames != NULL) { if (frames != NULL) {
for (AUTO_VAR(it, frames->begin()); it != frames->end(); ++it) { for (auto it = frames->begin(); it != frames->end(); ++it) {
delete *it; delete *it;
} }
delete frames; delete frames;
@ -218,7 +218,7 @@ void StitchedTexture::loadAnimationFrames(BufferedReader* bufferedReader) {
if (line.length() > 0) { if (line.length() > 0) {
std::vector<std::wstring> tokens = stringSplit(line, L','); std::vector<std::wstring> tokens = stringSplit(line, L',');
// for (String token : tokens) // for (String token : tokens)
for (AUTO_VAR(it, tokens.begin()); it != tokens.end(); ++it) { for (auto it = tokens.begin(); it != tokens.end(); ++it) {
std::wstring token = *it; std::wstring token = *it;
int multiPos = token.find_first_of('*'); int multiPos = token.find_first_of('*');
if (multiPos > 0) { if (multiPos > 0) {
@ -258,7 +258,7 @@ void StitchedTexture::loadAnimationFrames(const std::wstring& string) {
std::vector<std::wstring> tokens = stringSplit(trimString(string), L','); std::vector<std::wstring> tokens = stringSplit(trimString(string), L',');
// for (String token : tokens) // for (String token : tokens)
for (AUTO_VAR(it, tokens.begin()); it != tokens.end(); ++it) { for (auto it = tokens.begin(); it != tokens.end(); ++it) {
std::wstring token = trimString(*it); std::wstring token = trimString(*it);
int multiPos = token.find_first_of('*'); int multiPos = token.find_first_of('*');
if (multiPos > 0) { if (multiPos > 0) {

View file

@ -73,7 +73,7 @@ void Stitcher::stitch() {
stitchedTexture = NULL; stitchedTexture = NULL;
// for (int i = 0; i < textureHolders.length; i++) // for (int i = 0; i < textureHolders.length; i++)
for (AUTO_VAR(it, texturesToBeStitched.begin()); for (auto it = texturesToBeStitched.begin();
it != texturesToBeStitched.end(); ++it) { it != texturesToBeStitched.end(); ++it) {
TextureHolder* textureHolder = *it; // textureHolders[i]; TextureHolder* textureHolder = *it; // textureHolders[i];
@ -91,7 +91,7 @@ std::vector<StitchSlot*>* Stitcher::gatherAreas() {
std::vector<StitchSlot*>* result = new std::vector<StitchSlot*>(); std::vector<StitchSlot*>* result = new std::vector<StitchSlot*>();
// for (StitchSlot slot : storage) // for (StitchSlot slot : storage)
for (AUTO_VAR(it, storage.begin()); it != storage.end(); ++it) { for (auto it = storage.begin(); it != storage.end(); ++it) {
StitchSlot* slot = *it; StitchSlot* slot = *it;
slot->collectAssignments(result); slot->collectAssignments(result);
} }

View file

@ -59,7 +59,7 @@ void TextureMap::stitch() {
Stitcher* stitcher = TextureManager::getInstance()->createStitcher(name); Stitcher* stitcher = TextureManager::getInstance()->createStitcher(name);
for (AUTO_VAR(it, texturesByName.begin()); it != texturesByName.end(); for (auto it = texturesByName.begin(); it != texturesByName.end();
++it) { ++it) {
delete it->second; delete it->second;
} }
@ -83,7 +83,7 @@ void TextureMap::stitch() {
// Extract frames from textures and add them to the stitchers // Extract frames from textures and add them to the stitchers
// for (final String name : texturesToRegister.keySet()) // for (final String name : texturesToRegister.keySet())
for (AUTO_VAR(it, texturesToRegister.begin()); for (auto it = texturesToRegister.begin();
it != texturesToRegister.end(); ++it) { it != texturesToRegister.end(); ++it) {
std::wstring name = it->first; std::wstring name = it->first;
@ -120,9 +120,9 @@ void TextureMap::stitch() {
stitchResult = stitcher->constructTexture(m_mipMap); stitchResult = stitcher->constructTexture(m_mipMap);
// Extract all the final positions and store them // Extract all the final positions and store them
AUTO_VAR(areas, stitcher->gatherAreas()); auto areas = stitcher->gatherAreas();
// for (StitchSlot slot : stitcher.gatherAreas()) // for (StitchSlot slot : stitcher.gatherAreas())
for (AUTO_VAR(it, areas->begin()); it != areas->end(); ++it) { for (auto it = areas->begin(); it != areas->end(); ++it) {
StitchSlot* slot = *it; StitchSlot* slot = *it;
TextureHolder* textureHolder = slot->getHolder(); TextureHolder* textureHolder = slot->getHolder();
@ -133,7 +133,7 @@ void TextureMap::stitch() {
StitchedTexture* stored = NULL; StitchedTexture* stored = NULL;
AUTO_VAR(itTex, texturesToRegister.find(textureName)); auto itTex = texturesToRegister.find(textureName);
if (itTex != texturesToRegister.end()) stored = itTex->second; if (itTex != texturesToRegister.end()) stored = itTex->second;
// [EB]: What is this code for? debug warnings for when during // [EB]: What is this code for? debug warnings for when during
@ -194,7 +194,7 @@ void TextureMap::stitch() {
missingPosition = texturesByName.find(NAME_MISSING_TEXTURE)->second; missingPosition = texturesByName.find(NAME_MISSING_TEXTURE)->second;
// for (StitchedTexture texture : texturesToRegister.values()) // for (StitchedTexture texture : texturesToRegister.values())
for (AUTO_VAR(it, texturesToRegister.begin()); for (auto it = texturesToRegister.begin();
it != texturesToRegister.end(); ++it) { it != texturesToRegister.end(); ++it) {
StitchedTexture* texture = it->second; StitchedTexture* texture = it->second;
texture->replaceWith(missingPosition); texture->replaceWith(missingPosition);
@ -212,7 +212,7 @@ StitchedTexture* TextureMap::getTexture(const std::wstring& name) {
void TextureMap::cycleAnimationFrames() { void TextureMap::cycleAnimationFrames() {
// for (StitchedTexture texture : animatedTextures) // for (StitchedTexture texture : animatedTextures)
for (AUTO_VAR(it, animatedTextures.begin()); it != animatedTextures.end(); for (auto it = animatedTextures.begin(); it != animatedTextures.end();
++it) { ++it) {
StitchedTexture* texture = *it; StitchedTexture* texture = *it;
texture->cycleFrames(); texture->cycleFrames();
@ -233,7 +233,7 @@ Icon* TextureMap::registerIcon(const std::wstring& name) {
// TODO: [EB]: Why do we allow multiple registrations? // TODO: [EB]: Why do we allow multiple registrations?
StitchedTexture* result = NULL; StitchedTexture* result = NULL;
AUTO_VAR(it, texturesToRegister.find(name)); auto it = texturesToRegister.find(name);
if (it != texturesToRegister.end()) result = it->second; if (it != texturesToRegister.end()) result = it->second;
if (result == NULL) { if (result == NULL) {

View file

@ -36,7 +36,7 @@ void TextureManager::registerName(const std::wstring& name, Texture* texture) {
} }
void TextureManager::registerTexture(Texture* texture) { void TextureManager::registerTexture(Texture* texture) {
for (AUTO_VAR(it, idToTextureMap.begin()); it != idToTextureMap.end(); for (auto it = idToTextureMap.begin(); it != idToTextureMap.end();
++it) { ++it) {
if (it->second == texture) { if (it->second == texture) {
// Minecraft.getInstance().getLogger().warning("TextureManager.registerTexture // Minecraft.getInstance().getLogger().warning("TextureManager.registerTexture
@ -55,10 +55,10 @@ void TextureManager::registerTexture(Texture* texture) {
void TextureManager::unregisterTexture(const std::wstring& name, void TextureManager::unregisterTexture(const std::wstring& name,
Texture* texture) { Texture* texture) {
AUTO_VAR(it, idToTextureMap.find(texture->getManagerId())); auto it = idToTextureMap.find(texture->getManagerId());
if (it != idToTextureMap.end()) idToTextureMap.erase(it); if (it != idToTextureMap.end()) idToTextureMap.erase(it);
AUTO_VAR(it2, stringToIDMap.find(name)); auto it2 = stringToIDMap.find(name);
if (it2 != stringToIDMap.end()) stringToIDMap.erase(it2); if (it2 != stringToIDMap.end()) stringToIDMap.erase(it2);
} }

View file

@ -993,7 +993,7 @@ void Textures::removeHttpTexture(const std::wstring& url) {
int Textures::loadMemTexture(const std::wstring& url, int Textures::loadMemTexture(const std::wstring& url,
const std::wstring& backup) { const std::wstring& backup) {
MemTexture* texture = NULL; MemTexture* texture = NULL;
AUTO_VAR(it, memTextures.find(url)); auto it = memTextures.find(url);
if (it != memTextures.end()) { if (it != memTextures.end()) {
texture = (*it).second; texture = (*it).second;
} }
@ -1030,7 +1030,7 @@ int Textures::loadMemTexture(const std::wstring& url,
int Textures::loadMemTexture(const std::wstring& url, int backup) { int Textures::loadMemTexture(const std::wstring& url, int backup) {
MemTexture* texture = NULL; MemTexture* texture = NULL;
AUTO_VAR(it, memTextures.find(url)); auto it = memTextures.find(url);
if (it != memTextures.end()) { if (it != memTextures.end()) {
texture = (*it).second; texture = (*it).second;
} }
@ -1067,7 +1067,7 @@ int Textures::loadMemTexture(const std::wstring& url, int backup) {
MemTexture* Textures::addMemTexture(const std::wstring& name, MemTexture* Textures::addMemTexture(const std::wstring& name,
MemTextureProcessor* processor) { MemTextureProcessor* processor) {
MemTexture* texture = NULL; MemTexture* texture = NULL;
AUTO_VAR(it, memTextures.find(name)); auto it = memTextures.find(name);
if (it != memTextures.end()) { if (it != memTextures.end()) {
texture = (*it).second; texture = (*it).second;
} }
@ -1107,7 +1107,7 @@ MemTexture* Textures::addMemTexture(const std::wstring& name,
void Textures::removeMemTexture(const std::wstring& url) { void Textures::removeMemTexture(const std::wstring& url) {
MemTexture* texture = NULL; MemTexture* texture = NULL;
AUTO_VAR(it, memTextures.find(url)); auto it = memTextures.find(url);
if (it != memTextures.end()) { if (it != memTextures.end()) {
texture = (*it).second; texture = (*it).second;
@ -1153,7 +1153,7 @@ void Textures::tick(
// 4J - go over all the memory textures once per frame, and free any that // 4J - go over all the memory textures once per frame, and free any that
// haven't been used for a while. Ones that are being used will have their // haven't been used for a while. Ones that are being used will have their
// ticksSinceLastUse reset in Textures::loadMemTexture. // ticksSinceLastUse reset in Textures::loadMemTexture.
for (AUTO_VAR(it, memTextures.begin()); it != memTextures.end();) { for (auto it = memTextures.begin(); it != memTextures.end();) {
MemTexture* tex = it->second; MemTexture* tex = it->second;
if (tex && if (tex &&

View file

@ -321,8 +321,8 @@ void Font::drawWordWrapInternal(const std::wstring& string, int x, int y, int w,
int col, bool darken, int h) { int col, bool darken, int h) {
std::vector<std::wstring> lines = stringSplit(string, L'\n'); std::vector<std::wstring> lines = stringSplit(string, L'\n');
if (lines.size() > 1) { if (lines.size() > 1) {
AUTO_VAR(itEnd, lines.end()); auto itEnd = lines.end();
for (AUTO_VAR(it, lines.begin()); it != itEnd; it++) { for (auto it = lines.begin(); it != itEnd; it++) {
// 4J Stu - Don't draw text that will be partially cutoff/overlap // 4J Stu - Don't draw text that will be partially cutoff/overlap
// something it shouldn't // something it shouldn't
if ((y + this->wordWrapHeight(*it, w)) > h) break; if ((y + this->wordWrapHeight(*it, w)) > h) break;
@ -366,8 +366,8 @@ int Font::wordWrapHeight(const std::wstring& string, int w) {
std::vector<std::wstring> lines = stringSplit(string, L'\n'); std::vector<std::wstring> lines = stringSplit(string, L'\n');
if (lines.size() > 1) { if (lines.size() > 1) {
int h = 0; int h = 0;
AUTO_VAR(itEnd, lines.end()); auto itEnd = lines.end();
for (AUTO_VAR(it, lines.begin()); it != itEnd; it++) { for (auto it = lines.begin(); it != itEnd; it++) {
h += this->wordWrapHeight(*it, w); h += this->wordWrapHeight(*it, w);
} }
return h; return h;

View file

@ -1331,8 +1331,8 @@ void Gui::tick() {
// viewing the Pause Menu. We don't show the guiMessages when a menu is // viewing the Pause Menu. We don't show the guiMessages when a menu is
// up, so don't fade them out // up, so don't fade them out
if (!ui.GetMenuDisplayed(iPad)) { if (!ui.GetMenuDisplayed(iPad)) {
AUTO_VAR(itEnd, guiMessages[iPad].end()); auto itEnd = guiMessages[iPad].end();
for (AUTO_VAR(it, guiMessages[iPad].begin()); it != itEnd; it++) { for (auto it = guiMessages[iPad].begin(); it != itEnd; it++) {
(*it).ticks++; (*it).ticks++;
} }
} }

View file

@ -18,8 +18,8 @@ Screen::Screen() // 4J added
} }
void Screen::render(int xm, int ym, float a) { void Screen::render(int xm, int ym, float a) {
AUTO_VAR(itEnd, buttons.end()); auto itEnd = buttons.end();
for (AUTO_VAR(it, buttons.begin()); it != itEnd; it++) { for (auto it = buttons.begin(); it != itEnd; it++) {
Button* button = *it; // buttons[i]; Button* button = *it; // buttons[i];
button->render(minecraft, xm, ym); button->render(minecraft, xm, ym);
} }
@ -49,8 +49,8 @@ void Screen::setClipboard(const std::wstring& str) {
void Screen::mouseClicked(int x, int y, int buttonNum) { void Screen::mouseClicked(int x, int y, int buttonNum) {
if (buttonNum == 0) { if (buttonNum == 0) {
AUTO_VAR(itEnd, buttons.end()); auto itEnd = buttons.end();
for (AUTO_VAR(it, buttons.begin()); it != itEnd; it++) { for (auto it = buttons.begin(); it != itEnd; it++) {
Button* button = *it; // buttons[i]; Button* button = *it; // buttons[i];
if (button->clicked(minecraft, x, y)) { if (button->clicked(minecraft, x, y)) {
clickedButton = button; clickedButton = button;

View file

@ -49,8 +49,8 @@ void AbstractContainerScreen::render(int xm, int ym, float a) {
Slot* hoveredSlot = NULL; Slot* hoveredSlot = NULL;
AUTO_VAR(itEnd, menu->slots.end()); auto itEnd = menu->slots.end();
for (AUTO_VAR(it, menu->slots.begin()); it != itEnd; it++) { for (auto it = menu->slots.begin(); it != itEnd; it++) {
Slot* slot = *it; // menu->slots.at(i); Slot* slot = *it; // menu->slots.at(i);
renderSlot(slot); renderSlot(slot);
@ -300,8 +300,8 @@ void AbstractContainerScreen::renderSlot(Slot* slot) {
} }
Slot* AbstractContainerScreen::findSlot(int x, int y) { Slot* AbstractContainerScreen::findSlot(int x, int y) {
AUTO_VAR(itEnd, menu->slots.end()); auto itEnd = menu->slots.end();
for (AUTO_VAR(it, menu->slots.begin()); it != itEnd; it++) { for (auto it = menu->slots.begin(); it != itEnd; it++) {
Slot* slot = *it; // menu->slots.at(i); Slot* slot = *it; // menu->slots.at(i);
if (isHovering(slot, x, y)) return slot; if (isHovering(slot, x, y)) return slot;
} }

View file

@ -71,7 +71,7 @@ ArchiveFile::~ArchiveFile() { delete m_cachedData; }
std::vector<std::wstring>* ArchiveFile::getFileList() { std::vector<std::wstring>* ArchiveFile::getFileList() {
std::vector<std::wstring>* out = new std::vector<std::wstring>(); std::vector<std::wstring>* out = new std::vector<std::wstring>();
for (AUTO_VAR(it, m_index.begin()); it != m_index.end(); it++) for (auto it = m_index.begin(); it != m_index.end(); it++)
out->push_back(it->first); out->push_back(it->first);
@ -88,7 +88,7 @@ int ArchiveFile::getFileSize(const std::wstring& filename) {
byteArray ArchiveFile::getFile(const std::wstring& filename) { byteArray ArchiveFile::getFile(const std::wstring& filename) {
byteArray out; byteArray out;
AUTO_VAR(it, m_index.find(filename)); auto it = m_index.find(filename);
if (it == m_index.end()) { if (it == m_index.end()) {
app.DebugPrintf("Couldn't find file in archive\n"); app.DebugPrintf("Couldn't find file in archive\n");

View file

@ -20,7 +20,7 @@ int MemoryTracker::genTextures() {
} }
void MemoryTracker::releaseLists(int id) { void MemoryTracker::releaseLists(int id) {
AUTO_VAR(it, GL_LIST_IDS.find(id)); auto it = GL_LIST_IDS.find(id);
if (it != GL_LIST_IDS.end()) { if (it != GL_LIST_IDS.end()) {
glDeleteLists(id, it->second); glDeleteLists(id, it->second);
GL_LIST_IDS.erase(it); GL_LIST_IDS.erase(it);
@ -36,7 +36,7 @@ void MemoryTracker::releaseTextures() {
void MemoryTracker::release() { void MemoryTracker::release() {
// for (Map.Entry<Integer, Integer> entry : GL_LIST_IDS.entrySet()) // for (Map.Entry<Integer, Integer> entry : GL_LIST_IDS.entrySet())
for (AUTO_VAR(it, GL_LIST_IDS.begin()); it != GL_LIST_IDS.end(); ++it) { for (auto it = GL_LIST_IDS.begin(); it != GL_LIST_IDS.end(); ++it) {
glDeleteLists(it->first, it->second); glDeleteLists(it->first, it->second);
} }
GL_LIST_IDS.clear(); GL_LIST_IDS.clear();

View file

@ -43,11 +43,11 @@ void StringTable::ProcessStringTableData(void) {
int dataSize = 0; int dataSize = 0;
// //
for (AUTO_VAR(it_locales, locales.begin()); for (auto it_locales = locales.begin();
it_locales != locales.end() && (!foundLang); it_locales++) { it_locales != locales.end() && (!foundLang); it_locales++) {
bytesToSkip = 0; bytesToSkip = 0;
for (AUTO_VAR(it, langSizeMap.begin()); it != langSizeMap.end(); ++it) { for (auto it = langSizeMap.begin(); it != langSizeMap.end(); ++it) {
if (it->first.compare(*it_locales) == 0) { if (it->first.compare(*it_locales) == 0) {
app.DebugPrintf("StringTable:: Found language '%ls'.\n", app.DebugPrintf("StringTable:: Found language '%ls'.\n",
it_locales->c_str()); it_locales->c_str());
@ -135,7 +135,7 @@ const wchar_t* StringTable::getString(const std::wstring& id) {
} }
#endif #endif
AUTO_VAR(it, m_stringsMap.find(id)); auto it = m_stringsMap.find(id);
if (it != m_stringsMap.end()) { if (it != m_stringsMap.end()) {
return it->second.c_str(); return it->second.c_str();

View file

@ -3,7 +3,7 @@
#include "BaseAttributeMap.h" #include "BaseAttributeMap.h"
BaseAttributeMap::~BaseAttributeMap() { BaseAttributeMap::~BaseAttributeMap() {
for (AUTO_VAR(it, attributesById.begin()); it != attributesById.end(); for (auto it = attributesById.begin(); it != attributesById.end();
++it) { ++it) {
delete it->second; delete it->second;
} }
@ -14,7 +14,7 @@ AttributeInstance* BaseAttributeMap::getInstance(Attribute* attribute) {
} }
AttributeInstance* BaseAttributeMap::getInstance(eATTRIBUTE_ID id) { AttributeInstance* BaseAttributeMap::getInstance(eATTRIBUTE_ID id) {
AUTO_VAR(it, attributesById.find(id)); auto it = attributesById.find(id);
if (it != attributesById.end()) { if (it != attributesById.end()) {
return it->second; return it->second;
} else { } else {
@ -23,7 +23,7 @@ AttributeInstance* BaseAttributeMap::getInstance(eATTRIBUTE_ID id) {
} }
void BaseAttributeMap::getAttributes(std::vector<AttributeInstance*>& atts) { void BaseAttributeMap::getAttributes(std::vector<AttributeInstance*>& atts) {
for (AUTO_VAR(it, attributesById.begin()); it != attributesById.end(); for (auto it = attributesById.begin(); it != attributesById.end();
++it) { ++it) {
atts.push_back(it->second); atts.push_back(it->second);
} }
@ -35,7 +35,7 @@ void BaseAttributeMap::onAttributeModified(
void BaseAttributeMap::removeItemModifiers(std::shared_ptr<ItemInstance> item) { void BaseAttributeMap::removeItemModifiers(std::shared_ptr<ItemInstance> item) {
attrAttrModMap* modifiers = item->getAttributeModifiers(); attrAttrModMap* modifiers = item->getAttributeModifiers();
for (AUTO_VAR(it, modifiers->begin()); it != modifiers->end(); ++it) { for (auto it = modifiers->begin(); it != modifiers->end(); ++it) {
AttributeInstance* attribute = getInstance(it->first); AttributeInstance* attribute = getInstance(it->first);
AttributeModifier* modifier = it->second; AttributeModifier* modifier = it->second;
@ -52,7 +52,7 @@ void BaseAttributeMap::removeItemModifiers(std::shared_ptr<ItemInstance> item) {
void BaseAttributeMap::addItemModifiers(std::shared_ptr<ItemInstance> item) { void BaseAttributeMap::addItemModifiers(std::shared_ptr<ItemInstance> item) {
attrAttrModMap* modifiers = item->getAttributeModifiers(); attrAttrModMap* modifiers = item->getAttributeModifiers();
for (AUTO_VAR(it, modifiers->begin()); it != modifiers->end(); ++it) { for (auto it = modifiers->begin(); it != modifiers->end(); ++it) {
AttributeInstance* attribute = getInstance(it->first); AttributeInstance* attribute = getInstance(it->first);
AttributeModifier* modifier = it->second; AttributeModifier* modifier = it->second;

View file

@ -15,7 +15,7 @@ ModifiableAttributeInstance::ModifiableAttributeInstance(
ModifiableAttributeInstance::~ModifiableAttributeInstance() { ModifiableAttributeInstance::~ModifiableAttributeInstance() {
for (int i = 0; i < AttributeModifier::TOTAL_OPERATIONS; i++) { for (int i = 0; i < AttributeModifier::TOTAL_OPERATIONS; i++) {
for (AUTO_VAR(it, modifiers[i].begin()); it != modifiers[i].end(); for (auto it = modifiers[i].begin(); it != modifiers[i].end();
++it) { ++it) {
// Delete all modifiers // Delete all modifiers
delete *it; delete *it;
@ -45,7 +45,7 @@ void ModifiableAttributeInstance::getModifiers(
for (int i = 0; i < AttributeModifier::TOTAL_OPERATIONS; i++) { for (int i = 0; i < AttributeModifier::TOTAL_OPERATIONS; i++) {
std::unordered_set<AttributeModifier*>* opModifiers = &modifiers[i]; std::unordered_set<AttributeModifier*>* opModifiers = &modifiers[i];
for (AUTO_VAR(it, opModifiers->begin()); it != opModifiers->end(); for (auto it = opModifiers->begin(); it != opModifiers->end();
++it) { ++it) {
result.insert(*it); result.insert(*it);
} }
@ -55,7 +55,7 @@ void ModifiableAttributeInstance::getModifiers(
AttributeModifier* ModifiableAttributeInstance::getModifier(eMODIFIER_ID id) { AttributeModifier* ModifiableAttributeInstance::getModifier(eMODIFIER_ID id) {
AttributeModifier* modifier = NULL; AttributeModifier* modifier = NULL;
AUTO_VAR(it, modifierById.find(id)); auto it = modifierById.find(id);
if (it != modifierById.end()) { if (it != modifierById.end()) {
modifier = it->second; modifier = it->second;
} }
@ -65,7 +65,7 @@ AttributeModifier* ModifiableAttributeInstance::getModifier(eMODIFIER_ID id) {
void ModifiableAttributeInstance::addModifiers( void ModifiableAttributeInstance::addModifiers(
std::unordered_set<AttributeModifier*>* modifiers) { std::unordered_set<AttributeModifier*>* modifiers) {
for (AUTO_VAR(it, modifiers->begin()); it != modifiers->end(); ++it) { for (auto it = modifiers->begin(); it != modifiers->end(); ++it) {
addModifier(*it); addModifier(*it);
} }
} }
@ -94,7 +94,7 @@ void ModifiableAttributeInstance::setDirty() {
void ModifiableAttributeInstance::removeModifier(AttributeModifier* modifier) { void ModifiableAttributeInstance::removeModifier(AttributeModifier* modifier) {
for (int i = 0; i < AttributeModifier::TOTAL_OPERATIONS; i++) { for (int i = 0; i < AttributeModifier::TOTAL_OPERATIONS; i++) {
for (AUTO_VAR(it, modifiers[i].begin()); it != modifiers[i].end(); for (auto it = modifiers[i].begin(); it != modifiers[i].end();
++it) { ++it) {
if (modifier->equals(*it)) { if (modifier->equals(*it)) {
modifiers[i].erase(it); modifiers[i].erase(it);
@ -117,7 +117,7 @@ void ModifiableAttributeInstance::removeModifiers() {
std::unordered_set<AttributeModifier*> removingModifiers; std::unordered_set<AttributeModifier*> removingModifiers;
getModifiers(removingModifiers); getModifiers(removingModifiers);
for (AUTO_VAR(it, removingModifiers.begin()); it != removingModifiers.end(); for (auto it = removingModifiers.begin(); it != removingModifiers.end();
++it) { ++it) {
removeModifier(*it); removeModifier(*it);
} }
@ -137,7 +137,7 @@ double ModifiableAttributeInstance::calculateValue() {
std::unordered_set<AttributeModifier*>* modifiers; std::unordered_set<AttributeModifier*>* modifiers;
modifiers = getModifiers(AttributeModifier::OPERATION_ADDITION); modifiers = getModifiers(AttributeModifier::OPERATION_ADDITION);
for (AUTO_VAR(it, modifiers->begin()); it != modifiers->end(); ++it) { for (auto it = modifiers->begin(); it != modifiers->end(); ++it) {
AttributeModifier* modifier = *it; AttributeModifier* modifier = *it;
base += modifier->getAmount(); base += modifier->getAmount();
} }
@ -145,13 +145,13 @@ double ModifiableAttributeInstance::calculateValue() {
double result = base; double result = base;
modifiers = getModifiers(AttributeModifier::OPERATION_MULTIPLY_BASE); modifiers = getModifiers(AttributeModifier::OPERATION_MULTIPLY_BASE);
for (AUTO_VAR(it, modifiers->begin()); it != modifiers->end(); ++it) { for (auto it = modifiers->begin(); it != modifiers->end(); ++it) {
AttributeModifier* modifier = *it; AttributeModifier* modifier = *it;
result += base * modifier->getAmount(); result += base * modifier->getAmount();
} }
modifiers = getModifiers(AttributeModifier::OPERATION_MULTIPLY_TOTAL); modifiers = getModifiers(AttributeModifier::OPERATION_MULTIPLY_TOTAL);
for (AUTO_VAR(it, modifiers->begin()); it != modifiers->end(); ++it) { for (auto it = modifiers->begin(); it != modifiers->end(); ++it) {
AttributeModifier* modifier = *it; AttributeModifier* modifier = *it;
result *= 1 + modifier->getAmount(); result *= 1 + modifier->getAmount();
} }

View file

@ -17,7 +17,7 @@ AttributeInstance* ServersideAttributeMap::getInstance(eATTRIBUTE_ID id) {
// If we didn't find it, search by legacy name // If we didn't find it, search by legacy name
/*if (result == NULL) /*if (result == NULL)
{ {
AUTO_VAR(it, attributesByLegacy.find(name)); auto it = attributesByLegacy.find(name);
if(it != attributesByLegacy.end()) if(it != attributesByLegacy.end())
{ {
result = it->second; result = it->second;
@ -29,7 +29,7 @@ AttributeInstance* ServersideAttributeMap::getInstance(eATTRIBUTE_ID id) {
AttributeInstance* ServersideAttributeMap::registerAttribute( AttributeInstance* ServersideAttributeMap::registerAttribute(
Attribute* attribute) { Attribute* attribute) {
AUTO_VAR(it, attributesById.find(attribute->getId())); auto it = attributesById.find(attribute->getId());
if (it != attributesById.end()) { if (it != attributesById.end()) {
return it->second; return it->second;
} }

View file

@ -13,10 +13,10 @@ bool Sensing::canSee(std::shared_ptr<Entity> target) {
// if ( find(seen.begin(), seen.end(), target) != seen.end() ) return true; // if ( find(seen.begin(), seen.end(), target) != seen.end() ) return true;
// if ( find(unseen.begin(), unseen.end(), target) != unseen.end()) return // if ( find(unseen.begin(), unseen.end(), target) != unseen.end()) return
// false; // false;
for (AUTO_VAR(it, seen.begin()); it != seen.end(); ++it) { for (auto it = seen.begin(); it != seen.end(); ++it) {
if (target == (*it).lock()) return true; if (target == (*it).lock()) return true;
} }
for (AUTO_VAR(it, unseen.begin()); it != unseen.end(); ++it) { for (auto it = unseen.begin(); it != unseen.end(); ++it) {
if (target == (*it).lock()) return false; if (target == (*it).lock()) return false;
} }

View file

@ -53,7 +53,7 @@ std::shared_ptr<Animal> BreedGoal::getFreePartner() {
level->getEntitiesOfClass(typeid(*animal), &grown_bb); level->getEntitiesOfClass(typeid(*animal), &grown_bb);
double dist = std::numeric_limits<double>::max(); double dist = std::numeric_limits<double>::max();
std::shared_ptr<Animal> partner = nullptr; std::shared_ptr<Animal> partner = nullptr;
for (AUTO_VAR(it, others->begin()); it != others->end(); ++it) { for (auto it = others->begin(); it != others->end(); ++it) {
std::shared_ptr<Animal> p = std::dynamic_pointer_cast<Animal>(*it); std::shared_ptr<Animal> p = std::dynamic_pointer_cast<Animal>(*it);
if (animal->canMate(p) && animal->distanceToSqr(p) < dist) { if (animal->canMate(p) && animal->distanceToSqr(p) < dist) {
partner = p; partner = p;

View file

@ -22,7 +22,7 @@ bool FollowParentGoal::canUse() {
std::shared_ptr<Animal> closest = nullptr; std::shared_ptr<Animal> closest = nullptr;
double closestDistSqr = std::numeric_limits<double>::max(); double closestDistSqr = std::numeric_limits<double>::max();
for (AUTO_VAR(it, parents->begin()); it != parents->end(); ++it) { for (auto it = parents->begin(); it != parents->end(); ++it) {
std::shared_ptr<Animal> parent = std::dynamic_pointer_cast<Animal>(*it); std::shared_ptr<Animal> parent = std::dynamic_pointer_cast<Animal>(*it);
if (parent->getAge() < 0) continue; if (parent->getAge() < 0) continue;
double distSqr = animal->distanceToSqr(parent); double distSqr = animal->distanceToSqr(parent);

View file

@ -15,7 +15,7 @@ GoalSelector::GoalSelector() {
} }
GoalSelector::~GoalSelector() { GoalSelector::~GoalSelector() {
for (AUTO_VAR(it, goals.begin()); it != goals.end(); ++it) { for (auto it = goals.begin(); it != goals.end(); ++it) {
if ((*it)->canDeletePointer) delete (*it)->goal; if ((*it)->canDeletePointer) delete (*it)->goal;
delete (*it); delete (*it);
} }
@ -29,12 +29,12 @@ void GoalSelector::addGoal(
} }
void GoalSelector::removeGoal(Goal* toRemove) { void GoalSelector::removeGoal(Goal* toRemove) {
for (AUTO_VAR(it, goals.begin()); it != goals.end();) { for (auto it = goals.begin(); it != goals.end();) {
InternalGoal* ig = *it; InternalGoal* ig = *it;
Goal* goal = ig->goal; Goal* goal = ig->goal;
if (goal == toRemove) { if (goal == toRemove) {
AUTO_VAR(it2, find(usingGoals.begin(), usingGoals.end(), ig)); auto it2 = find(usingGoals.begin(), usingGoals.end(), ig);
if (it2 != usingGoals.end()) { if (it2 != usingGoals.end()) {
goal->stop(); goal->stop();
usingGoals.erase(it2); usingGoals.erase(it2);
@ -54,10 +54,10 @@ void GoalSelector::tick() {
if (tickCount++ % newGoalRate == 0) { if (tickCount++ % newGoalRate == 0) {
// for (InternalGoal ig : goals) // for (InternalGoal ig : goals)
for (AUTO_VAR(it, goals.begin()); it != goals.end(); ++it) { for (auto it = goals.begin(); it != goals.end(); ++it) {
InternalGoal* ig = *it; InternalGoal* ig = *it;
// bool isUsing = usingGoals.contains(ig); // bool isUsing = usingGoals.contains(ig);
AUTO_VAR(usingIt, find(usingGoals.begin(), usingGoals.end(), ig)); auto usingIt = find(usingGoals.begin(), usingGoals.end(), ig);
// if (isUsing) // if (isUsing)
if (usingIt != usingGoals.end()) { if (usingIt != usingGoals.end()) {
@ -75,7 +75,7 @@ void GoalSelector::tick() {
usingGoals.push_back(ig); usingGoals.push_back(ig);
} }
} else { } else {
for (AUTO_VAR(it, usingGoals.begin()); it != usingGoals.end();) { for (auto it = usingGoals.begin(); it != usingGoals.end();) {
InternalGoal* ig = *it; InternalGoal* ig = *it;
if (!ig->goal->canContinueToUse()) { if (!ig->goal->canContinueToUse()) {
ig->goal->stop(); ig->goal->stop();
@ -89,14 +89,14 @@ void GoalSelector::tick() {
// bool debug = false; // bool debug = false;
// if (debug && toStart.size() > 0) System.out.println("Starting: "); // if (debug && toStart.size() > 0) System.out.println("Starting: ");
// for (InternalGoal ig : toStart) // for (InternalGoal ig : toStart)
for (AUTO_VAR(it, toStart.begin()); it != toStart.end(); ++it) { for (auto it = toStart.begin(); it != toStart.end(); ++it) {
// if (debug) System.out.println(ig.goal.toString() + ", "); // if (debug) System.out.println(ig.goal.toString() + ", ");
(*it)->goal->start(); (*it)->goal->start();
} }
// if (debug && usingGoals.size() > 0) System.out.println("Running: "); // if (debug && usingGoals.size() > 0) System.out.println("Running: ");
// for (InternalGoal ig : usingGoals) // for (InternalGoal ig : usingGoals)
for (AUTO_VAR(it, usingGoals.begin()); it != usingGoals.end(); ++it) { for (auto it = usingGoals.begin(); it != usingGoals.end(); ++it) {
// if (debug) System.out.println(ig.goal.toString()); // if (debug) System.out.println(ig.goal.toString());
(*it)->goal->tick(); (*it)->goal->tick();
} }
@ -112,11 +112,11 @@ bool GoalSelector::canContinueToUse(InternalGoal* ig) {
bool GoalSelector::canUseInSystem(GoalSelector::InternalGoal* goal) { bool GoalSelector::canUseInSystem(GoalSelector::InternalGoal* goal) {
// for (InternalGoal ig : goals) // for (InternalGoal ig : goals)
for (AUTO_VAR(it, goals.begin()); it != goals.end(); ++it) { for (auto it = goals.begin(); it != goals.end(); ++it) {
InternalGoal* ig = *it; InternalGoal* ig = *it;
if (ig == goal) continue; if (ig == goal) continue;
AUTO_VAR(usingIt, find(usingGoals.begin(), usingGoals.end(), ig)); auto usingIt = find(usingGoals.begin(), usingGoals.end(), ig);
if (goal->prio >= ig->prio) { if (goal->prio >= ig->prio) {
if (usingIt != usingGoals.end() && !canCoExist(goal, ig)) if (usingIt != usingGoals.end() && !canCoExist(goal, ig))
@ -139,7 +139,7 @@ void GoalSelector::setNewGoalRate(int newGoalRate) {
} }
void GoalSelector::setLevel(Level* level) { void GoalSelector::setLevel(Level* level) {
for (AUTO_VAR(it, goals.begin()); it != goals.end(); ++it) { for (auto it = goals.begin(); it != goals.end(); ++it) {
InternalGoal* ig = *it; InternalGoal* ig = *it;
ig->goal->setLevel(level); ig->goal->setLevel(level);
} }

View file

@ -26,7 +26,7 @@ void HurtByTargetGoal::start() {
std::vector<std::shared_ptr<Entity> >* nearby = std::vector<std::shared_ptr<Entity> >* nearby =
mob->level->getEntitiesOfClass( mob->level->getEntitiesOfClass(
typeid(*mob), &mob_bb); typeid(*mob), &mob_bb);
for (AUTO_VAR(it, nearby->begin()); it != nearby->end(); ++it) { for (auto it = nearby->begin(); it != nearby->end(); ++it) {
std::shared_ptr<PathfinderMob> other = std::shared_ptr<PathfinderMob> other =
std::dynamic_pointer_cast<PathfinderMob>(*it); std::dynamic_pointer_cast<PathfinderMob>(*it);
if (this->mob->shared_from_this() == other) continue; if (this->mob->shared_from_this() == other) continue;

View file

@ -91,7 +91,7 @@ std::shared_ptr<DoorInfo> MoveThroughVillageGoal::getNextDoorInfo(
std::vector<std::shared_ptr<DoorInfo> >* doorInfos = std::vector<std::shared_ptr<DoorInfo> >* doorInfos =
village->getDoorInfos(); village->getDoorInfos();
// for (DoorInfo di : doorInfos) // for (DoorInfo di : doorInfos)
for (AUTO_VAR(it, doorInfos->begin()); it != doorInfos->end(); ++it) { for (auto it = doorInfos->begin(); it != doorInfos->end(); ++it) {
std::shared_ptr<DoorInfo> di = *it; std::shared_ptr<DoorInfo> di = *it;
int distSqr = di->distanceToSqr(Mth::floor(mob->x), Mth::floor(mob->y), int distSqr = di->distanceToSqr(Mth::floor(mob->x), Mth::floor(mob->y),
Mth::floor(mob->z)); Mth::floor(mob->z));
@ -106,7 +106,7 @@ std::shared_ptr<DoorInfo> MoveThroughVillageGoal::getNextDoorInfo(
bool MoveThroughVillageGoal::hasVisited(std::shared_ptr<DoorInfo> di) { bool MoveThroughVillageGoal::hasVisited(std::shared_ptr<DoorInfo> di) {
// for (DoorInfo di2 : visited) // for (DoorInfo di2 : visited)
for (AUTO_VAR(it, visited.begin()); it != visited.end();) { for (auto it = visited.begin(); it != visited.end();) {
std::shared_ptr<DoorInfo> di2 = (*it).lock(); std::shared_ptr<DoorInfo> di2 = (*it).lock();
if (di2 == NULL) { if (di2 == NULL) {
it = visited.erase(it); it = visited.erase(it);

View file

@ -28,7 +28,7 @@ bool PlayGoal::canUse() {
mob->level->getEntitiesOfClass(typeid(Villager), &mob_bb); mob->level->getEntitiesOfClass(typeid(Villager), &mob_bb);
double closestDistSqr = std::numeric_limits<double>::max(); double closestDistSqr = std::numeric_limits<double>::max();
// for (Entity c : children) // for (Entity c : children)
for (AUTO_VAR(it, children->begin()); it != children->end(); ++it) { for (auto it = children->begin(); it != children->end(); ++it) {
std::shared_ptr<Entity> c = *it; std::shared_ptr<Entity> c = *it;
if (c.get() == mob) continue; if (c.get() == mob) continue;
std::shared_ptr<Villager> friendV = std::shared_ptr<Villager> friendV =

View file

@ -32,7 +32,7 @@ bool TakeFlowerGoal::canUse() {
} }
// for (Entity e : golems) // for (Entity e : golems)
for (AUTO_VAR(it, golems->begin()); it != golems->end(); ++it) { for (auto it = golems->begin(); it != golems->end(); ++it) {
std::shared_ptr<VillagerGolem> vg = std::shared_ptr<VillagerGolem> vg =
std::dynamic_pointer_cast<VillagerGolem>(*it); std::dynamic_pointer_cast<VillagerGolem>(*it);
if (vg->getOfferFlowerTick() > 0) { if (vg->getOfferFlowerTick() > 0) {

View file

@ -26,8 +26,8 @@ PathFinder::~PathFinder() {
// so just need to destroy their containers // so just need to destroy their containers
delete[] neighbors->data; delete[] neighbors->data;
delete neighbors; delete neighbors;
AUTO_VAR(itEnd, nodes.end()); auto itEnd = nodes.end();
for (AUTO_VAR(it, nodes.begin()); it != itEnd; it++) { for (auto it = nodes.begin(); it != itEnd; it++) {
delete it->second; delete it->second;
} }
} }
@ -188,7 +188,7 @@ Node* PathFinder::getNode(Entity* entity, int x, int y, int z, Node* size,
/*final*/ Node* PathFinder::getNode(int x, int y, int z) { /*final*/ Node* PathFinder::getNode(int x, int y, int z) {
int i = Node::createHash(x, y, z); int i = Node::createHash(x, y, z);
Node* node; Node* node;
AUTO_VAR(it, nodes.find(i)); auto it = nodes.find(i);
if (it == nodes.end()) { if (it == nodes.end()) {
MemSect(54); MemSect(54);
node = new Node(x, y, z); node = new Node(x, y, z);

View file

@ -117,8 +117,8 @@ BaseRailTile::Rail* BaseRailTile::Rail::getRail(TilePos* p) {
bool BaseRailTile::Rail::connectsTo(Rail* rail) { bool BaseRailTile::Rail::connectsTo(Rail* rail) {
if (m_bValidRail) { if (m_bValidRail) {
AUTO_VAR(itEnd, connections.end()); auto itEnd = connections.end();
for (AUTO_VAR(it, connections.begin()); it != itEnd; it++) { for (auto it = connections.begin(); it != itEnd; it++) {
TilePos* p = *it; // connections[i]; TilePos* p = *it; // connections[i];
if (p->x == rail->x && p->z == rail->z) { if (p->x == rail->x && p->z == rail->z) {
return true; return true;
@ -130,8 +130,8 @@ bool BaseRailTile::Rail::connectsTo(Rail* rail) {
bool BaseRailTile::Rail::hasConnection(int x, int y, int z) { bool BaseRailTile::Rail::hasConnection(int x, int y, int z) {
if (m_bValidRail) { if (m_bValidRail) {
AUTO_VAR(itEnd, connections.end()); auto itEnd = connections.end();
for (AUTO_VAR(it, connections.begin()); it != itEnd; it++) { for (auto it = connections.begin(); it != itEnd; it++) {
TilePos* p = *it; // connections[i]; TilePos* p = *it; // connections[i];
if (p->x == x && p->z == z) { if (p->x == x && p->z == z) {
return true; return true;
@ -278,8 +278,8 @@ void BaseRailTile::Rail::place(bool hasSignal, bool first) {
if (first || level->getData(x, y, z) != data) { if (first || level->getData(x, y, z) != data) {
level->setData(x, y, z, data, Tile::UPDATE_ALL); level->setData(x, y, z, data, Tile::UPDATE_ALL);
AUTO_VAR(itEnd, connections.end()); auto itEnd = connections.end();
for (AUTO_VAR(it, connections.begin()); it != itEnd; it++) { for (auto it = connections.begin(); it != itEnd; it++) {
Rail* neighbor = getRail(*it); Rail* neighbor = getRail(*it);
if (neighbor == NULL) continue; if (neighbor == NULL) continue;
neighbor->removeSoftConnections(); neighbor->removeSoftConnections();

View file

@ -97,8 +97,8 @@ bool BedTile::use(Level* level, int x, int y, int z,
if (isOccupied(data)) { if (isOccupied(data)) {
std::shared_ptr<Player> sleepingPlayer = nullptr; std::shared_ptr<Player> sleepingPlayer = nullptr;
AUTO_VAR(itEnd, level->players.end()); auto itEnd = level->players.end();
for (AUTO_VAR(it, level->players.begin()); it != itEnd; it++) { for (auto it = level->players.begin(); it != itEnd; it++) {
std::shared_ptr<Player> p = *it; std::shared_ptr<Player> p = *it;
if (p->isSleeping()) { if (p->isSleeping()) {
Pos pos = p->bedPosition; Pos pos = p->bedPosition;

View file

@ -348,7 +348,7 @@ bool ChestTile::isCatSittingOnChest(Level* level, int x, int y, int z) {
AABB ocelot_aabb(x, y + 1, z, x + 1, y + 2, z + 1); AABB ocelot_aabb(x, y + 1, z, x + 1, y + 2, z + 1);
std::vector<std::shared_ptr<Entity> >* entities = std::vector<std::shared_ptr<Entity> >* entities =
level->getEntitiesOfClass(typeid(Ocelot), &ocelot_aabb); level->getEntitiesOfClass(typeid(Ocelot), &ocelot_aabb);
for (AUTO_VAR(it, entities->begin()); it != entities->end(); ++it) { for (auto it = entities->begin(); it != entities->end(); ++it) {
std::shared_ptr<Ocelot> ocelot = std::dynamic_pointer_cast<Ocelot>(*it); std::shared_ptr<Ocelot> ocelot = std::dynamic_pointer_cast<Ocelot>(*it);
if (ocelot->isSitting()) { if (ocelot->isSitting()) {
delete entities; delete entities;

View file

@ -122,7 +122,7 @@ void FallingTile::tick() {
CompoundTag* swap = new CompoundTag(); CompoundTag* swap = new CompoundTag();
tileEntity->save(swap); tileEntity->save(swap);
std::vector<Tag*>* allTags = tileData->getAllTags(); std::vector<Tag*>* allTags = tileData->getAllTags();
for (AUTO_VAR(it, allTags->begin()); for (auto it = allTags->begin();
it != allTags->end(); ++it) { it != allTags->end(); ++it) {
Tag* tag = *it; Tag* tag = *it;
if (tag->getName().compare(L"x") == 0 || if (tag->getName().compare(L"x") == 0 ||
@ -173,7 +173,7 @@ void FallingTile::causeFallDamage(float distance) {
? DamageSource::anvil ? DamageSource::anvil
: DamageSource::fallingBlock; : DamageSource::fallingBlock;
// for (Entity entity : entities) // for (Entity entity : entities)
for (AUTO_VAR(it, entities->begin()); it != entities->end(); ++it) { for (auto it = entities->begin(); it != entities->end(); ++it) {
(*it)->hurt(source, std::min(Mth::floor(dmg * fallDamageAmount), (*it)->hurt(source, std::min(Mth::floor(dmg * fallDamageAmount),
fallDamageMax)); fallDamageMax));
} }

View file

@ -133,8 +133,8 @@ const int MobSpawner::tick(ServerLevel* level, bool spawnEnemies,
continue; continue;
} }
AUTO_VAR(itEndCTP, chunksToPoll.end()); auto itEndCTP = chunksToPoll.end();
for (AUTO_VAR(it, chunksToPoll.begin()); it != itEndCTP; it++) { for (auto it = chunksToPoll.begin(); it != itEndCTP; it++) {
if (it->second) { if (it->second) {
// don't add mobs to edge chunks, to prevent adding mobs // don't add mobs to edge chunks, to prevent adding mobs
// "outside" of the active playground // "outside" of the active playground

View file

@ -30,8 +30,8 @@ bool NotGateTile::isToggledTooFrequently(Level* level, int x, int y, int z,
recentToggles[level]->push_back(Toggle(x, y, z, level->getGameTime())); recentToggles[level]->push_back(Toggle(x, y, z, level->getGameTime()));
int count = 0; int count = 0;
AUTO_VAR(itEnd, recentToggles[level]->end()); auto itEnd = recentToggles[level]->end();
for (AUTO_VAR(it, recentToggles[level]->begin()); it != itEnd; it++) { for (auto it = recentToggles[level]->begin(); it != itEnd; it++) {
if (it->x == x && it->y == y && it->z == z) { if (it->x == x && it->y == y && it->z == z) {
count++; count++;
if (count >= MAX_RECENT_TOGGLES) { if (count >= MAX_RECENT_TOGGLES) {
@ -207,7 +207,7 @@ void NotGateTile::levelTimeChanged(Level* level, int64_t delta,
std::deque<Toggle>* toggles = recentToggles[level]; std::deque<Toggle>* toggles = recentToggles[level];
if (toggles != NULL) { if (toggles != NULL) {
for (AUTO_VAR(it, toggles->begin()); it != toggles->end(); ++it) { for (auto it = toggles->begin(); it != toggles->end(); ++it) {
(*it).when += delta; (*it).when += delta;
} }
} }

View file

@ -36,7 +36,7 @@ int PressurePlateTile::getSignalStrength(Level* level, int x, int y, int z) {
// location. // location.
if (entities != NULL && !entities->empty()) { if (entities != NULL && !entities->empty()) {
for (AUTO_VAR(it, entities->begin()); it != entities->end(); ++it) { for (auto it = entities->begin(); it != entities->end(); ++it) {
std::shared_ptr<Entity> e = *it; std::shared_ptr<Entity> e = *it;
if (!e->isIgnoringTileTriggers()) { if (!e->isIgnoringTileTriggers()) {
if (sensitivity != everything) delete entities; if (sensitivity != everything) delete entities;

View file

@ -78,8 +78,8 @@ void RedStoneDustTile::updatePowerStrength(Level* level, int x, int y, int z) {
std::vector<TilePos>(toUpdate.begin(), toUpdate.end()); std::vector<TilePos>(toUpdate.begin(), toUpdate.end());
toUpdate.clear(); toUpdate.clear();
AUTO_VAR(itEnd, updates.end()); auto itEnd = updates.end();
for (AUTO_VAR(it, updates.begin()); it != itEnd; it++) { for (auto it = updates.begin(); it != itEnd; it++) {
TilePos tp = *it; TilePos tp = *it;
level->updateNeighborsAt(tp.x, tp.y, tp.z, id); level->updateNeighborsAt(tp.x, tp.y, tp.z, id);
} }

Some files were not shown because too many files have changed in this diff Show more