mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-05-08 19:17:12 +00:00
refactor: expand AUTO_VAR macro
This commit is contained in:
parent
a330ecdcbb
commit
e45151ae64
|
|
@ -131,7 +131,7 @@ void MultiPlayerLevel::tick() {
|
|||
// 4J HEG - Copy the connections vector to prevent crash when moving to
|
||||
// Nether
|
||||
std::vector<ClientConnection*> connectionsTemp = connections;
|
||||
for (AUTO_VAR(connection, connectionsTemp.begin());
|
||||
for (auto connection = connectionsTemp.begin();
|
||||
connection < connectionsTemp.end(); ++connection) {
|
||||
(*connection)->tick();
|
||||
}
|
||||
|
|
@ -391,8 +391,8 @@ void MultiPlayerLevel::tickTiles() {
|
|||
PIXEndNamedEvent();
|
||||
|
||||
PIXBeginNamedEvent(0, "Ticking client side tiles");
|
||||
AUTO_VAR(itEndCtp, chunksToPoll.end());
|
||||
for (AUTO_VAR(it, chunksToPoll.begin()); it != itEndCtp; it++) {
|
||||
auto itEndCtp = chunksToPoll.end();
|
||||
for (auto it = chunksToPoll.begin(); it != itEndCtp; it++) {
|
||||
ChunkPos cp = *it;
|
||||
int xo = cp.x * 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
|
||||
// continually removing and re-adding things, in particular the
|
||||
// MultiPlayerLocalPlayer when they die
|
||||
AUTO_VAR(it, reEntries.find(e));
|
||||
auto it = reEntries.find(e);
|
||||
if (it != reEntries.end()) {
|
||||
reEntries.erase(it);
|
||||
}
|
||||
|
|
@ -443,7 +443,7 @@ void MultiPlayerLevel::removeEntity(std::shared_ptr<Entity> e) {
|
|||
|
||||
void MultiPlayerLevel::entityAdded(std::shared_ptr<Entity> e) {
|
||||
Level::entityAdded(e);
|
||||
AUTO_VAR(it, reEntries.find(e));
|
||||
auto it = reEntries.find(e);
|
||||
if (it != reEntries.end()) {
|
||||
reEntries.erase(it);
|
||||
}
|
||||
|
|
@ -451,7 +451,7 @@ void MultiPlayerLevel::entityAdded(std::shared_ptr<Entity> e) {
|
|||
|
||||
void MultiPlayerLevel::entityRemoved(std::shared_ptr<Entity> e) {
|
||||
Level::entityRemoved(e);
|
||||
AUTO_VAR(it, forced.find(e));
|
||||
auto it = forced.find(e);
|
||||
if (it != forced.end()) {
|
||||
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) {
|
||||
AUTO_VAR(it, entitiesById.find(id));
|
||||
auto it = entitiesById.find(id);
|
||||
if (it == entitiesById.end()) return nullptr;
|
||||
return it->second;
|
||||
}
|
||||
|
||||
std::shared_ptr<Entity> MultiPlayerLevel::removeEntity(int id) {
|
||||
std::shared_ptr<Entity> e;
|
||||
AUTO_VAR(it, entitiesById.find(id));
|
||||
auto it = entitiesById.find(id);
|
||||
if (it != entitiesById.end()) {
|
||||
e = it->second;
|
||||
entitiesById.erase(it);
|
||||
|
|
@ -495,10 +495,10 @@ std::shared_ptr<Entity> MultiPlayerLevel::removeEntity(int id) {
|
|||
// remove entities slightly differently
|
||||
void MultiPlayerLevel::removeEntities(
|
||||
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;
|
||||
|
||||
AUTO_VAR(reIt, reEntries.find(e));
|
||||
auto reIt = reEntries.find(e);
|
||||
if (reIt != reEntries.end()) {
|
||||
reEntries.erase(reIt);
|
||||
}
|
||||
|
|
@ -613,12 +613,12 @@ bool MultiPlayerLevel::doSetTileAndData(int x, int y, int z, int tile,
|
|||
|
||||
void MultiPlayerLevel::disconnect(bool sendDisconnect /*= true*/) {
|
||||
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>(
|
||||
new DisconnectPacket(DisconnectPacket::eDisconnect_Quitting)));
|
||||
}
|
||||
} else {
|
||||
for (AUTO_VAR(it, connections.begin()); it < connections.end(); ++it) {
|
||||
for (auto it = connections.begin(); it < connections.end(); ++it) {
|
||||
(*it)->close();
|
||||
}
|
||||
}
|
||||
|
|
@ -704,7 +704,7 @@ void MultiPlayerLevel::animateTickDoWork() {
|
|||
MemSect(0);
|
||||
|
||||
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++) {
|
||||
int packed = *it;
|
||||
// 4jcraft changed the extraction logic to be safe
|
||||
|
|
@ -809,9 +809,9 @@ void MultiPlayerLevel::removeAllPendingEntityRemovals() {
|
|||
// entities.removeAll(entitiesToRemove);
|
||||
|
||||
EnterCriticalSection(&m_entitiesCS);
|
||||
for (AUTO_VAR(it, entities.begin()); it != entities.end();) {
|
||||
for (auto it = entities.begin(); it != entities.end();) {
|
||||
bool found = false;
|
||||
for (AUTO_VAR(it2, entitiesToRemove.begin());
|
||||
for (auto it2 = entitiesToRemove.begin();
|
||||
it2 != entitiesToRemove.end(); it2++) {
|
||||
if ((*it) == (*it2)) {
|
||||
found = true;
|
||||
|
|
@ -826,8 +826,8 @@ void MultiPlayerLevel::removeAllPendingEntityRemovals() {
|
|||
}
|
||||
LeaveCriticalSection(&m_entitiesCS);
|
||||
|
||||
AUTO_VAR(endIt, entitiesToRemove.end());
|
||||
for (AUTO_VAR(it, entitiesToRemove.begin()); it != endIt; it++) {
|
||||
auto endIt = entitiesToRemove.end();
|
||||
for (auto it = entitiesToRemove.begin(); it != endIt; it++) {
|
||||
std::shared_ptr<Entity> e = *it;
|
||||
int xc = e->xChunk;
|
||||
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
|
||||
// Java does...
|
||||
endIt = entitiesToRemove.end();
|
||||
for (AUTO_VAR(it, entitiesToRemove.begin()); it != endIt; it++) {
|
||||
for (auto it = entitiesToRemove.begin(); it != endIt; it++) {
|
||||
entityRemoved(*it);
|
||||
}
|
||||
entitiesToRemove.clear();
|
||||
|
|
@ -884,7 +884,7 @@ void MultiPlayerLevel::removeClientConnection(ClientConnection* c,
|
|||
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()) {
|
||||
connections.erase(it);
|
||||
}
|
||||
|
|
@ -892,7 +892,7 @@ void MultiPlayerLevel::removeClientConnection(ClientConnection* c,
|
|||
|
||||
void MultiPlayerLevel::tickAllConnections() {
|
||||
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();
|
||||
}
|
||||
PIXEndNamedEvent();
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ ServerLevel::~ServerLevel() {
|
|||
delete mobSpawner;
|
||||
|
||||
EnterCriticalSection(&m_csQueueSendTileUpdates);
|
||||
for (AUTO_VAR(it, m_queuedSendTileUpdates.begin());
|
||||
for (auto it = m_queuedSendTileUpdates.begin();
|
||||
it != m_queuedSendTileUpdates.end(); ++it) {
|
||||
Pos* p = *it;
|
||||
delete p;
|
||||
|
|
@ -270,8 +270,8 @@ void ServerLevel::tick() {
|
|||
if (!SharedConstants::TEXTURE_LIGHTING) // 4J - change brought forward
|
||||
// from 1.8.2
|
||||
{
|
||||
AUTO_VAR(itEnd, listeners.end());
|
||||
for (AUTO_VAR(it, listeners.begin()); it != itEnd; it++) {
|
||||
auto itEnd = listeners.end();
|
||||
for (auto it = listeners.begin(); it != itEnd; it++) {
|
||||
(*it)->skyColorChanged();
|
||||
}
|
||||
}
|
||||
|
|
@ -361,8 +361,8 @@ void ServerLevel::updateSleepingPlayerList() {
|
|||
allPlayersSleeping = !players.empty();
|
||||
m_bAtLeastOnePlayerSleeping = false;
|
||||
|
||||
AUTO_VAR(itEnd, players.end());
|
||||
for (AUTO_VAR(it, players.begin()); it != itEnd; it++) {
|
||||
auto itEnd = players.end();
|
||||
for (auto it = players.begin(); it != itEnd; it++) {
|
||||
if (!(*it)->isSleeping()) {
|
||||
allPlayersSleeping = false;
|
||||
// break;
|
||||
|
|
@ -377,7 +377,7 @@ void ServerLevel::awakenAllPlayers() {
|
|||
allPlayersSleeping = false;
|
||||
m_bAtLeastOnePlayerSleeping = false;
|
||||
|
||||
AUTO_VAR(itEnd, players.end());
|
||||
auto itEnd = players.end();
|
||||
for (std::vector<std::shared_ptr<Player> >::iterator it = players.begin();
|
||||
it != itEnd; it++) {
|
||||
if ((*it)->isSleeping()) {
|
||||
|
|
@ -398,7 +398,7 @@ void ServerLevel::stopWeather() {
|
|||
bool ServerLevel::allPlayersAreSleeping() {
|
||||
if (allPlayersSleeping && !isClientSide) {
|
||||
// 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 =
|
||||
players.begin();
|
||||
it != itEnd; it++) {
|
||||
|
|
@ -483,8 +483,8 @@ void ServerLevel::tickTiles() {
|
|||
if (app.GetGameSettingsDebugMask() & (1L << eDebugSetting_RegularLightning))
|
||||
prob = 100;
|
||||
|
||||
AUTO_VAR(itEndCtp, chunksToPoll.end());
|
||||
for (AUTO_VAR(it, chunksToPoll.begin()); it != itEndCtp; it++) {
|
||||
auto itEndCtp = chunksToPoll.end();
|
||||
for (auto it = chunksToPoll.begin(); it != itEndCtp; it++) {
|
||||
ChunkPos cp = *it;
|
||||
int xo = cp.x * 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;
|
||||
|
||||
AUTO_VAR(itTickList, tickNextTickList.begin());
|
||||
auto itTickList = tickNextTickList.begin();
|
||||
for (int i = 0; i < count; i++) {
|
||||
TickNextTickData td = *(itTickList);
|
||||
if (!force && td.m_delay > levelData->getGameTime()) {
|
||||
|
|
@ -665,7 +665,7 @@ bool ServerLevel::tickPendingTicks(bool force) {
|
|||
toBeTicked.push_back(td);
|
||||
}
|
||||
|
||||
for (AUTO_VAR(it, toBeTicked.begin()); it != toBeTicked.end();) {
|
||||
for (auto it = toBeTicked.begin(); it != toBeTicked.end();) {
|
||||
TickNextTickData td = *it;
|
||||
it = toBeTicked.erase(it);
|
||||
|
||||
|
|
@ -707,7 +707,7 @@ std::vector<TickNextTickData>* ServerLevel::fetchTicksInChunk(LevelChunk* chunk,
|
|||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
if (i == 0) {
|
||||
for (AUTO_VAR(it, tickNextTickList.begin());
|
||||
for (auto it = tickNextTickList.begin();
|
||||
it != tickNextTickList.end();) {
|
||||
TickNextTickData td = *it;
|
||||
|
||||
|
|
@ -729,7 +729,7 @@ std::vector<TickNextTickData>* ServerLevel::fetchTicksInChunk(LevelChunk* chunk,
|
|||
if (!toBeTicked.empty()) {
|
||||
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;
|
||||
|
||||
if (td.x >= xMin && td.x < xMax && td.z >= zMin &&
|
||||
|
|
@ -954,7 +954,7 @@ void ServerLevel::save(bool force, ProgressListener* progressListener,
|
|||
// clean cache
|
||||
std::vector<LevelChunk*>* loadedChunkList =
|
||||
cache->getLoadedChunkList();
|
||||
for (AUTO_VAR(it, loadedChunkList->begin());
|
||||
for (auto it = loadedChunkList->begin();
|
||||
it != loadedChunkList->end(); ++it) {
|
||||
LevelChunk* lc = *it;
|
||||
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();
|
||||
if (es != NULL) {
|
||||
// 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(
|
||||
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();
|
||||
if (es != NULL) {
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
|
@ -1070,7 +1070,7 @@ std::shared_ptr<Explosion> ServerLevel::explode(std::shared_ptr<Entity> source,
|
|||
}
|
||||
|
||||
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::dynamic_pointer_cast<ServerPlayer>(*it);
|
||||
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));
|
||||
TileEventData newEvent(x, y, z, tile, b0, b1);
|
||||
// for (TileEventData te : tileEvents[activeTileEventsList])
|
||||
for (AUTO_VAR(it, tileEvents[activeTileEventsList].begin());
|
||||
for (auto it = tileEvents[activeTileEventsList].begin();
|
||||
it != tileEvents[activeTileEventsList].end(); ++it) {
|
||||
if ((*it).equals(newEvent)) {
|
||||
return;
|
||||
|
|
@ -1132,7 +1132,7 @@ void ServerLevel::runTileEvents() {
|
|||
activeTileEventsList ^= 1;
|
||||
|
||||
// for (TileEventData te : tileEvents[runList])
|
||||
for (AUTO_VAR(it, tileEvents[runList].begin());
|
||||
for (auto it = tileEvents[runList].begin();
|
||||
it != tileEvents[runList].end(); ++it) {
|
||||
if (doTileEvent(&(*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
|
||||
// set.
|
||||
std::vector<TickNextTickData> temp;
|
||||
for (AUTO_VAR(it, tickNextTickList.begin()); it != tickNextTickList.end();
|
||||
for (auto it = tickNextTickList.begin(); it != tickNextTickList.end();
|
||||
++it) {
|
||||
temp.push_back(*it);
|
||||
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,
|
||||
(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::dynamic_pointer_cast<ServerPlayer>(*it);
|
||||
player->connection->send(packet);
|
||||
|
|
@ -1232,7 +1232,7 @@ void ServerLevel::queueSendTileUpdate(int x, int y, int z) {
|
|||
|
||||
void ServerLevel::runQueuedSendTileUpdates() {
|
||||
EnterCriticalSection(&m_csQueueSendTileUpdates);
|
||||
for (AUTO_VAR(it, m_queuedSendTileUpdates.begin());
|
||||
for (auto it = m_queuedSendTileUpdates.begin();
|
||||
it != m_queuedSendTileUpdates.end(); ++it) {
|
||||
Pos* p = *it;
|
||||
sendTileUpdated(p->x, p->y, p->z);
|
||||
|
|
@ -1372,7 +1372,7 @@ void ServerLevel::entityRemovedExtra(std::shared_ptr<Entity> e) {
|
|||
EnterCriticalSection(&m_limiterCS);
|
||||
// printf("entity removed: item entity count
|
||||
//%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()) {
|
||||
// printf("Item to remove found\n");
|
||||
m_itemEntities.erase(it);
|
||||
|
|
@ -1384,8 +1384,8 @@ void ServerLevel::entityRemovedExtra(std::shared_ptr<Entity> e) {
|
|||
EnterCriticalSection(&m_limiterCS);
|
||||
// printf("entity removed: item entity count
|
||||
//%d\n",m_itemEntities.size());
|
||||
AUTO_VAR(it,
|
||||
find(m_hangingEntities.begin(), m_hangingEntities.end(), e));
|
||||
auto it =
|
||||
find(m_hangingEntities.begin(), m_hangingEntities.end(), e);
|
||||
if (it != m_hangingEntities.end()) {
|
||||
// printf("Item to remove found\n");
|
||||
m_hangingEntities.erase(it);
|
||||
|
|
@ -1397,7 +1397,7 @@ void ServerLevel::entityRemovedExtra(std::shared_ptr<Entity> e) {
|
|||
EnterCriticalSection(&m_limiterCS);
|
||||
// printf("entity removed: arrow entity count
|
||||
//%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()) {
|
||||
// printf("Item to remove found\n");
|
||||
m_arrowEntities.erase(it);
|
||||
|
|
@ -1409,8 +1409,8 @@ void ServerLevel::entityRemovedExtra(std::shared_ptr<Entity> e) {
|
|||
EnterCriticalSection(&m_limiterCS);
|
||||
// printf("entity removed: experience orb entity count
|
||||
//%d\n",m_arrowEntities.size());
|
||||
AUTO_VAR(it, find(m_experienceOrbEntities.begin(),
|
||||
m_experienceOrbEntities.end(), e));
|
||||
auto it = find(m_experienceOrbEntities.begin(),
|
||||
m_experienceOrbEntities.end(), e);
|
||||
if (it != m_experienceOrbEntities.end()) {
|
||||
// printf("Item to remove found\n");
|
||||
m_experienceOrbEntities.erase(it);
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ void ServerLevelListener::globalLevelEvent(int type, int sourceX, int sourceY,
|
|||
void ServerLevelListener::destroyTileProgress(int id, int x, int y, int z,
|
||||
int progress) {
|
||||
// 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) {
|
||||
std::shared_ptr<ServerPlayer> p = *it;
|
||||
if (p == NULL || p->level != level || p->entityId == id) continue;
|
||||
|
|
|
|||
|
|
@ -4484,8 +4484,8 @@ void Minecraft::tickAllConnections() {
|
|||
|
||||
bool Minecraft::addPendingClientTextureRequest(
|
||||
const std::wstring& textureName) {
|
||||
AUTO_VAR(it, find(m_pendingTextureRequests.begin(),
|
||||
m_pendingTextureRequests.end(), textureName));
|
||||
auto it = find(m_pendingTextureRequests.begin(),
|
||||
m_pendingTextureRequests.end(), textureName);
|
||||
if (it == m_pendingTextureRequests.end()) {
|
||||
m_pendingTextureRequests.push_back(textureName);
|
||||
return true;
|
||||
|
|
@ -4494,8 +4494,8 @@ bool Minecraft::addPendingClientTextureRequest(
|
|||
}
|
||||
|
||||
void Minecraft::handleClientTextureReceived(const std::wstring& textureName) {
|
||||
AUTO_VAR(it, find(m_pendingTextureRequests.begin(),
|
||||
m_pendingTextureRequests.end(), textureName));
|
||||
auto it = find(m_pendingTextureRequests.begin(),
|
||||
m_pendingTextureRequests.end(), textureName);
|
||||
if (it != m_pendingTextureRequests.end()) {
|
||||
m_pendingTextureRequests.erase(it);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1396,7 +1396,7 @@ void MinecraftServer::broadcastStopSavingPacket() {
|
|||
|
||||
void MinecraftServer::tick() {
|
||||
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;
|
||||
if (t > 0) {
|
||||
ironTimers[it->first] = t - 1;
|
||||
|
|
@ -1512,7 +1512,7 @@ void MinecraftServer::handleConsoleInput(const std::wstring& msg,
|
|||
|
||||
void MinecraftServer::handleConsoleInputs() {
|
||||
while (consoleInput.size() > 0) {
|
||||
AUTO_VAR(it, consoleInput.begin());
|
||||
auto it = consoleInput.begin();
|
||||
ConsoleInput* input = *it;
|
||||
consoleInput.erase(it);
|
||||
// commands->handleCommand(input); // 4J - removed
|
||||
|
|
@ -1612,8 +1612,8 @@ void MinecraftServer::chunkPacketManagement_PreTick() {
|
|||
|
||||
do {
|
||||
int longestTime = 0;
|
||||
AUTO_VAR(playerConnectionBest, playersOrig.begin());
|
||||
for (AUTO_VAR(it, playersOrig.begin()); it != playersOrig.end();
|
||||
auto playerConnectionBest = playersOrig.begin();
|
||||
for (auto it = playersOrig.begin(); it != playersOrig.end();
|
||||
it++) {
|
||||
int thisTime = 0;
|
||||
INetworkPlayer* np = (*it)->getNetworkPlayer();
|
||||
|
|
|
|||
|
|
@ -605,7 +605,7 @@ void ClientConnection::handleAddEntity(
|
|||
if (subEntities != NULL) {
|
||||
int offs = packet->id - e->entityId;
|
||||
// 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)->entityId += offs;
|
||||
// subEntities[i].entityId += offs;
|
||||
|
|
@ -2003,7 +2003,7 @@ void ClientConnection::handleAddMob(std::shared_ptr<AddMobPacket> packet) {
|
|||
if (subEntities != NULL) {
|
||||
int offs = packet->id - mob->entityId;
|
||||
// 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) {
|
||||
// subEntities[i].entityId += offs;
|
||||
(*it)->entityId += offs;
|
||||
|
|
@ -3444,7 +3444,7 @@ void ClientConnection::handleUpdateAttributes(
|
|||
(std::dynamic_pointer_cast<LivingEntity>(entity))->getAttributes();
|
||||
std::unordered_set<UpdateAttributesPacket::AttributeSnapshot*>
|
||||
attributeSnapshots = packet->getValues();
|
||||
for (AUTO_VAR(it, attributeSnapshots.begin());
|
||||
for (auto it = attributeSnapshots.begin();
|
||||
it != attributeSnapshots.end(); ++it) {
|
||||
UpdateAttributesPacket::AttributeSnapshot* attribute = *it;
|
||||
AttributeInstance* instance =
|
||||
|
|
@ -3465,7 +3465,7 @@ void ClientConnection::handleUpdateAttributes(
|
|||
std::unordered_set<AttributeModifier*>* modifiers =
|
||||
attribute->getModifiers();
|
||||
|
||||
for (AUTO_VAR(it2, modifiers->begin()); it2 != modifiers->end();
|
||||
for (auto it2 = modifiers->begin(); it2 != modifiers->end();
|
||||
++it2) {
|
||||
AttributeModifier* modifier = *it2;
|
||||
instance->addModifier(
|
||||
|
|
|
|||
|
|
@ -98,8 +98,8 @@ MultiPlayerChunkCache::~MultiPlayerChunkCache() {
|
|||
delete cache;
|
||||
delete hasData;
|
||||
|
||||
AUTO_VAR(itEnd, loadedChunkList.end());
|
||||
for (AUTO_VAR(it, loadedChunkList.begin()); it != itEnd; it++) delete *it;
|
||||
auto itEnd = loadedChunkList.end();
|
||||
for (auto it = loadedChunkList.begin(); it != itEnd; it++) delete *it;
|
||||
|
||||
DeleteCriticalSection(&m_csLoadCreate);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ void PendingConnection::sendPreLoginResponse() {
|
|||
StorageManager.GetSaveUniqueFilename(szUniqueMapName);
|
||||
|
||||
PlayerList* playerList = MinecraftServer::getInstance()->getPlayers();
|
||||
for (AUTO_VAR(it, playerList->players.begin());
|
||||
for (auto it = playerList->players.begin();
|
||||
it != playerList->players.end(); ++it) {
|
||||
std::shared_ptr<ServerPlayer> player = *it;
|
||||
// If the offline Xuid is invalid but the online one is not then that's
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ PlayerChunkMap::PlayerChunk::~PlayerChunk() { delete changedTiles.data; }
|
|||
// output flag array and adds to it for this ServerPlayer.
|
||||
void PlayerChunkMap::flagEntitiesToBeRemoved(unsigned int* flags,
|
||||
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;
|
||||
serverPlayer->flagEntitiesToBeRemoved(flags, flagToBeRemoved);
|
||||
}
|
||||
|
|
@ -89,7 +89,7 @@ void PlayerChunkMap::PlayerChunk::remove(std::shared_ptr<ServerPlayer> player) {
|
|||
|
||||
// app.DebugPrintf("--- PlayerChunkMap::PlayerChunk::remove
|
||||
// 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()) {
|
||||
app.DebugPrintf(
|
||||
"--- 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);
|
||||
updateInhabitedTime(chunk);
|
||||
AUTO_VAR(it, find(parent->knownChunks.begin(),
|
||||
parent->knownChunks.end(), this));
|
||||
auto it = find(parent->knownChunks.begin(),
|
||||
parent->knownChunks.end(), this);
|
||||
if (it != parent->knownChunks.end()) parent->knownChunks.erase(it);
|
||||
}
|
||||
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()) {
|
||||
toDelete = it->second; // Don't delete until the end of the
|
||||
// function, as this might be this instance
|
||||
parent->chunks.erase(it);
|
||||
}
|
||||
if (changes > 0) {
|
||||
AUTO_VAR(it, find(parent->changedChunks.begin(),
|
||||
parent->changedChunks.end(), this));
|
||||
auto it = find(parent->changedChunks.begin(),
|
||||
parent->changedChunks.end(), this);
|
||||
parent->changedChunks.erase(it);
|
||||
}
|
||||
parent->getLevel()->cache->drop(pos.x, pos.z);
|
||||
|
|
@ -135,7 +135,7 @@ void PlayerChunkMap::PlayerChunk::remove(std::shared_ptr<ServerPlayer> player) {
|
|||
bool noOtherPlayersFound = true;
|
||||
|
||||
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;
|
||||
INetworkPlayer* currNetPlayer =
|
||||
currPlayer->connection->getNetworkPlayer();
|
||||
|
|
@ -405,7 +405,7 @@ PlayerChunkMap::PlayerChunkMap(ServerLevel* level, int dimension, int radius) {
|
|||
}
|
||||
|
||||
PlayerChunkMap::~PlayerChunkMap() {
|
||||
for (AUTO_VAR(it, chunks.begin()); it != chunks.end(); it++) {
|
||||
for (auto it = chunks.begin(); it != chunks.end(); it++) {
|
||||
delete it->second;
|
||||
}
|
||||
}
|
||||
|
|
@ -471,7 +471,7 @@ bool PlayerChunkMap::hasChunk(int x, int z) {
|
|||
PlayerChunkMap::PlayerChunk* PlayerChunkMap::getChunk(int x, int z,
|
||||
bool create) {
|
||||
int64_t id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32);
|
||||
AUTO_VAR(it, chunks.find(id));
|
||||
auto it = chunks.find(id);
|
||||
|
||||
PlayerChunk* chunk = NULL;
|
||||
if (it != chunks.end()) {
|
||||
|
|
@ -490,7 +490,7 @@ PlayerChunkMap::PlayerChunk* PlayerChunkMap::getChunk(int x, int z,
|
|||
void PlayerChunkMap::getChunkAndAddPlayer(
|
||||
int x, int z, std::shared_ptr<ServerPlayer> player) {
|
||||
int64_t id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32);
|
||||
AUTO_VAR(it, chunks.find(id));
|
||||
auto it = chunks.find(id);
|
||||
|
||||
if (it != chunks.end()) {
|
||||
it->second->add(player);
|
||||
|
|
@ -503,14 +503,14 @@ void PlayerChunkMap::getChunkAndAddPlayer(
|
|||
// there. Otherwise attempt to remove from main chunk map.
|
||||
void PlayerChunkMap::getChunkAndRemovePlayer(
|
||||
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)) {
|
||||
addRequests.erase(it);
|
||||
return;
|
||||
}
|
||||
}
|
||||
int64_t id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32);
|
||||
AUTO_VAR(it, chunks.find(id));
|
||||
auto it = chunks.find(id);
|
||||
|
||||
if (it != chunks.end()) {
|
||||
it->second->remove(player);
|
||||
|
|
@ -526,8 +526,8 @@ void PlayerChunkMap::tickAddRequests(std::shared_ptr<ServerPlayer> player) {
|
|||
int pz = (int)player->z;
|
||||
int minDistSq = -1;
|
||||
|
||||
AUTO_VAR(itNearest, addRequests.end());
|
||||
for (AUTO_VAR(it, addRequests.begin()); it != addRequests.end(); it++) {
|
||||
auto itNearest = addRequests.end();
|
||||
for (auto it = addRequests.begin(); it != addRequests.end(); it++) {
|
||||
if (it->player == player) {
|
||||
int xm = (it->x * 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);
|
||||
}
|
||||
|
||||
AUTO_VAR(it, find(players.begin(), players.end(), player));
|
||||
auto it = find(players.begin(), players.end(), player);
|
||||
if (players.size() > 0 && it != players.end())
|
||||
players.erase(find(players.begin(), players.end(), player));
|
||||
|
||||
// 4J - added - also remove any queued requests to be added to playerchunks
|
||||
// here
|
||||
for (AUTO_VAR(it, addRequests.begin()); it != addRequests.end();) {
|
||||
for (auto it = addRequests.begin(); it != addRequests.end();) {
|
||||
if (it->player == player) {
|
||||
it = addRequests.erase(it);
|
||||
} else {
|
||||
|
|
@ -764,10 +764,10 @@ bool PlayerChunkMap::isPlayerIn(std::shared_ptr<ServerPlayer> player,
|
|||
if (chunk == NULL) {
|
||||
return false;
|
||||
} else {
|
||||
AUTO_VAR(it1,
|
||||
find(chunk->players.begin(), chunk->players.end(), player));
|
||||
AUTO_VAR(it2, find(player->chunksToSend.begin(),
|
||||
player->chunksToSend.end(), chunk->pos));
|
||||
auto it1 =
|
||||
find(chunk->players.begin(), chunk->players.end(), player);
|
||||
auto it2 = find(player->chunksToSend.begin(),
|
||||
player->chunksToSend.end(), chunk->pos);
|
||||
return it1 != chunk->players.end() && it2 == player->chunksToSend.end();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -851,8 +851,8 @@ void PlayerConnection::handleTextureAndGeometry(
|
|||
void PlayerConnection::handleTextureReceived(const std::wstring& textureName) {
|
||||
// This sends the server received texture out to any other players waiting
|
||||
// for the data
|
||||
AUTO_VAR(it, find(m_texturesRequested.begin(), m_texturesRequested.end(),
|
||||
textureName));
|
||||
auto it = find(m_texturesRequested.begin(), m_texturesRequested.end(),
|
||||
textureName);
|
||||
if (it != m_texturesRequested.end()) {
|
||||
std::uint8_t* pbData = NULL;
|
||||
unsigned int dwBytes = 0;
|
||||
|
|
@ -870,8 +870,8 @@ void PlayerConnection::handleTextureAndGeometryReceived(
|
|||
const std::wstring& textureName) {
|
||||
// This sends the server received texture out to any other players waiting
|
||||
// for the data
|
||||
AUTO_VAR(it, find(m_texturesRequested.begin(), m_texturesRequested.end(),
|
||||
textureName));
|
||||
auto it = find(m_texturesRequested.begin(), m_texturesRequested.end(),
|
||||
textureName);
|
||||
if (it != m_texturesRequested.end()) {
|
||||
std::uint8_t* pbData = NULL;
|
||||
unsigned int dwTextureBytes = 0;
|
||||
|
|
@ -1270,7 +1270,7 @@ void PlayerConnection::handleSetCreativeModeSlot(
|
|||
|
||||
void PlayerConnection::handleContainerAck(
|
||||
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 &&
|
||||
player->containerMenu->containerId == packet->containerId &&
|
||||
|
|
@ -1335,7 +1335,7 @@ void PlayerConnection::handlePlayerInfo(
|
|||
player->isModerator()) {
|
||||
std::shared_ptr<ServerPlayer> serverPlayer;
|
||||
// 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) {
|
||||
std::shared_ptr<ServerPlayer> checkingPlayer = *it;
|
||||
if (checkingPlayer->connection->getNetworkPlayer() != NULL &&
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ PlayerList::PlayerList(MinecraftServer* server) {
|
|||
}
|
||||
|
||||
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
|
||||
// else there is a circular dependency
|
||||
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];
|
||||
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;
|
||||
}
|
||||
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->getGameRules()->getBoolean(GameRules::RULE_DAYLIGHT))));
|
||||
|
||||
AUTO_VAR(activeEffects, player->getActiveEffects());
|
||||
for (AUTO_VAR(it, activeEffects->begin()); it != activeEffects->end();
|
||||
auto activeEffects = player->getActiveEffects();
|
||||
for (auto it = activeEffects->begin(); it != activeEffects->end();
|
||||
++it) {
|
||||
MobEffectInstance* effect = *it;
|
||||
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
|
||||
INetworkPlayer* thisPlayer = player->connection->getNetworkPlayer();
|
||||
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;
|
||||
INetworkPlayer* checkPlayer =
|
||||
servPlayer->connection->getNetworkPlayer();
|
||||
|
|
@ -521,7 +521,7 @@ void PlayerList::remove(std::shared_ptr<ServerPlayer> player) {
|
|||
}
|
||||
level->removeEntity(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()) {
|
||||
players.erase(it);
|
||||
}
|
||||
|
|
@ -632,7 +632,7 @@ std::shared_ptr<ServerPlayer> PlayerList::respawn(
|
|||
}
|
||||
|
||||
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()) {
|
||||
players.erase(it);
|
||||
}
|
||||
|
|
@ -752,7 +752,7 @@ std::shared_ptr<ServerPlayer> PlayerList::respawn(
|
|||
if (keepAllPlayerData) {
|
||||
std::vector<MobEffectInstance*>* activeEffects =
|
||||
player->getActiveEffects();
|
||||
for (AUTO_VAR(it, activeEffects->begin()); it != activeEffects->end();
|
||||
for (auto it = activeEffects->begin(); it != activeEffects->end();
|
||||
++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:
|
||||
// Potion effects are removed after using the Nether Portal
|
||||
std::vector<MobEffectInstance*>* activeEffects = player->getActiveEffects();
|
||||
for (AUTO_VAR(it, activeEffects->begin()); it != activeEffects->end();
|
||||
for (auto it = activeEffects->begin(); it != activeEffects->end();
|
||||
++it) {
|
||||
MobEffectInstance* effect = *it;
|
||||
|
||||
|
|
@ -1409,7 +1409,7 @@ int PlayerList::getPlayerCount() { return (int)players.size(); }
|
|||
int PlayerList::getPlayerCount(ServerLevel* level) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
@ -1455,7 +1455,7 @@ std::shared_ptr<ServerPlayer> PlayerList::findAlivePlayerOnSystem(
|
|||
|
||||
INetworkPlayer* thisPlayer = player->connection->getNetworkPlayer();
|
||||
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;
|
||||
|
||||
INetworkPlayer* otherPlayer =
|
||||
|
|
@ -1488,8 +1488,8 @@ void PlayerList::removePlayerFromReceiving(std::shared_ptr<ServerPlayer> player,
|
|||
#endif
|
||||
bool playerRemoved = false;
|
||||
|
||||
AUTO_VAR(it, find(receiveAllPlayers[dimIndex].begin(),
|
||||
receiveAllPlayers[dimIndex].end(), player));
|
||||
auto it = find(receiveAllPlayers[dimIndex].begin(),
|
||||
receiveAllPlayers[dimIndex].end(), player);
|
||||
if (it != receiveAllPlayers[dimIndex].end()) {
|
||||
#if !defined(_CONTENT_PACKAGE)
|
||||
app.DebugPrintf(
|
||||
|
|
@ -1502,7 +1502,7 @@ void PlayerList::removePlayerFromReceiving(std::shared_ptr<ServerPlayer> player,
|
|||
|
||||
INetworkPlayer* thisPlayer = player->connection->getNetworkPlayer();
|
||||
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;
|
||||
|
||||
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
|
||||
// before we got here. Re-check all active players and make sure they
|
||||
// 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;
|
||||
INetworkPlayer* checkingPlayer =
|
||||
newPlayer->connection->getNetworkPlayer();
|
||||
|
|
@ -1540,7 +1540,7 @@ void PlayerList::removePlayerFromReceiving(std::shared_ptr<ServerPlayer> player,
|
|||
else if (newPlayer->dimension == 1)
|
||||
newPlayerDim = 2;
|
||||
bool foundPrimary = false;
|
||||
for (AUTO_VAR(it, receiveAllPlayers[newPlayerDim].begin());
|
||||
for (auto it = receiveAllPlayers[newPlayerDim].begin();
|
||||
it != receiveAllPlayers[newPlayerDim].end(); ++it) {
|
||||
std::shared_ptr<ServerPlayer> primaryPlayer = *it;
|
||||
INetworkPlayer* primPlayer =
|
||||
|
|
@ -1589,7 +1589,7 @@ void PlayerList::addPlayerToReceiving(std::shared_ptr<ServerPlayer> player) {
|
|||
#endif
|
||||
shouldAddPlayer = false;
|
||||
} else {
|
||||
for (AUTO_VAR(it, receiveAllPlayers[playerDim].begin());
|
||||
for (auto it = receiveAllPlayers[playerDim].begin();
|
||||
it != receiveAllPlayers[playerDim].end(); ++it) {
|
||||
std::shared_ptr<ServerPlayer> oldPlayer = *it;
|
||||
INetworkPlayer* checkingPlayer =
|
||||
|
|
@ -1617,7 +1617,7 @@ bool PlayerList::canReceiveAllPackets(std::shared_ptr<ServerPlayer> player) {
|
|||
playerDim = 1;
|
||||
else if (player->dimension == 1)
|
||||
playerDim = 2;
|
||||
for (AUTO_VAR(it, receiveAllPlayers[playerDim].begin());
|
||||
for (auto it = receiveAllPlayers[playerDim].begin();
|
||||
it != receiveAllPlayers[playerDim].end(); ++it) {
|
||||
std::shared_ptr<ServerPlayer> newPlayer = *it;
|
||||
if (newPlayer == player) {
|
||||
|
|
@ -1644,7 +1644,7 @@ bool PlayerList::isXuidBanned(PlayerUID xuid) {
|
|||
|
||||
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)) {
|
||||
banned = true;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -56,8 +56,8 @@ ServerChunkCache::~ServerChunkCache() {
|
|||
delete m_unloadedCache;
|
||||
#endif
|
||||
|
||||
AUTO_VAR(itEnd, m_loadedChunkList.end());
|
||||
for (AUTO_VAR(it, m_loadedChunkList.begin()); it != itEnd; it++) delete *it;
|
||||
auto itEnd = m_loadedChunkList.end();
|
||||
for (auto it = m_loadedChunkList.begin(); it != itEnd; it++) delete *it;
|
||||
DeleteCriticalSection(&m_csLoadCreate);
|
||||
}
|
||||
|
||||
|
|
@ -654,7 +654,7 @@ bool ServerChunkCache::saveAllEntities() {
|
|||
|
||||
PIXBeginNamedEvent(0, "saving to NBT");
|
||||
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) {
|
||||
storage->saveEntities(level, *it);
|
||||
}
|
||||
|
|
@ -676,8 +676,8 @@ bool ServerChunkCache::save(bool force, ProgressListener* progressListener) {
|
|||
// 4J - added this to support progressListner
|
||||
int count = 0;
|
||||
if (progressListener != NULL) {
|
||||
AUTO_VAR(itEnd, m_loadedChunkList.end());
|
||||
for (AUTO_VAR(it, m_loadedChunkList.begin()); it != itEnd; it++) {
|
||||
auto itEnd = m_loadedChunkList.end();
|
||||
for (auto it = m_loadedChunkList.begin(); it != itEnd; it++) {
|
||||
LevelChunk* chunk = *it;
|
||||
if (chunk->shouldSave(force)) {
|
||||
count++;
|
||||
|
|
@ -813,8 +813,8 @@ bool ServerChunkCache::tick() {
|
|||
|
||||
// loadedChunks.remove(cp);
|
||||
// loadedChunkList.remove(chunk);
|
||||
AUTO_VAR(it, find(m_loadedChunkList.begin(),
|
||||
m_loadedChunkList.end(), chunk));
|
||||
auto it = find(m_loadedChunkList.begin(),
|
||||
m_loadedChunkList.end(), chunk);
|
||||
if (it != m_loadedChunkList.end())
|
||||
m_loadedChunkList.erase(it);
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ void ServerCommandDispatcher::logAdminCommand(
|
|||
int customData, const std::wstring& additionalMessage) {
|
||||
PlayerList* playerList = MinecraftServer::getInstance()->getPlayers();
|
||||
// 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) {
|
||||
std::shared_ptr<ServerPlayer> player = *it;
|
||||
if (player != source && playerList->isOp(player)) {
|
||||
|
|
|
|||
|
|
@ -102,8 +102,8 @@ void ServerConnection::tick() {
|
|||
|
||||
bool ServerConnection::addPendingTextureRequest(
|
||||
const std::wstring& textureName) {
|
||||
AUTO_VAR(it, find(m_pendingTextureRequests.begin(),
|
||||
m_pendingTextureRequests.end(), textureName));
|
||||
auto it = find(m_pendingTextureRequests.begin(),
|
||||
m_pendingTextureRequests.end(), textureName);
|
||||
if (it == m_pendingTextureRequests.end()) {
|
||||
m_pendingTextureRequests.push_back(textureName);
|
||||
return true;
|
||||
|
|
@ -119,8 +119,8 @@ bool ServerConnection::addPendingTextureRequest(
|
|||
}
|
||||
|
||||
void ServerConnection::handleTextureReceived(const std::wstring& textureName) {
|
||||
AUTO_VAR(it, find(m_pendingTextureRequests.begin(),
|
||||
m_pendingTextureRequests.end(), textureName));
|
||||
auto it = find(m_pendingTextureRequests.begin(),
|
||||
m_pendingTextureRequests.end(), textureName);
|
||||
if (it != m_pendingTextureRequests.end()) {
|
||||
m_pendingTextureRequests.erase(it);
|
||||
}
|
||||
|
|
@ -134,8 +134,8 @@ void ServerConnection::handleTextureReceived(const std::wstring& textureName) {
|
|||
|
||||
void ServerConnection::handleTextureAndGeometryReceived(
|
||||
const std::wstring& textureName) {
|
||||
AUTO_VAR(it, find(m_pendingTextureRequests.begin(),
|
||||
m_pendingTextureRequests.end(), textureName));
|
||||
auto it = find(m_pendingTextureRequests.begin(),
|
||||
m_pendingTextureRequests.end(), textureName);
|
||||
if (it != m_pendingTextureRequests.end()) {
|
||||
m_pendingTextureRequests.erase(it);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1909,7 +1909,7 @@ void ConsoleSoundEngine::tick() {
|
|||
return;
|
||||
}
|
||||
|
||||
for (AUTO_VAR(it, scheduledSounds.begin()); it != scheduledSounds.end();) {
|
||||
for (auto it = scheduledSounds.begin(); it != scheduledSounds.end();) {
|
||||
SoundEngine::ScheduledSound* next = *it;
|
||||
next->delay--;
|
||||
|
||||
|
|
|
|||
|
|
@ -355,14 +355,14 @@ void ColourTable::loadColoursFromData(std::uint8_t* pbData,
|
|||
std::wstring colourId = dis.readUTF();
|
||||
int colourValue = dis.readInt();
|
||||
setColour(colourId, colourValue);
|
||||
AUTO_VAR(it, s_colourNamesMap.find(colourId));
|
||||
auto it = s_colourNamesMap.find(colourId);
|
||||
}
|
||||
|
||||
bais.reset();
|
||||
}
|
||||
|
||||
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()) {
|
||||
m_colourValues[(int)it->second] = value;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1127,7 +1127,7 @@ void CMinecraftApp::ActionGameSettings(int iPad, eGameSetting eVal) {
|
|||
|
||||
PlayerList* players =
|
||||
MinecraftServer::getInstance()->getPlayerList();
|
||||
for (AUTO_VAR(it3, players->players.begin());
|
||||
for (auto it3 = players->players.begin();
|
||||
it3 != players->players.end(); ++it3) {
|
||||
std::shared_ptr<ServerPlayer> decorationPlayer = *it3;
|
||||
decorationPlayer->setShowOnMaps(
|
||||
|
|
@ -4564,7 +4564,7 @@ bool CMinecraftApp::isXuidNotch(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
|
||||
if (it != MojangData.end()) {
|
||||
MOJANG_DATA* pMojangData = MojangData[xuid];
|
||||
|
|
@ -4582,7 +4582,7 @@ void CMinecraftApp::AddMemoryTextureFile(const std::wstring& wName,
|
|||
EnterCriticalSection(&csMemFilesLock);
|
||||
// check it's not already in
|
||||
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 !defined(_CONTENT_PACKAGE)
|
||||
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) {
|
||||
EnterCriticalSection(&csMemFilesLock);
|
||||
|
||||
AUTO_VAR(it, m_MEM_Files.find(wName));
|
||||
auto it = m_MEM_Files.find(wName);
|
||||
if (it != m_MEM_Files.end()) {
|
||||
#if !defined(_CONTENT_PACKAGE)
|
||||
wprintf(L"Decrementing the memory texture file count for %ls\n",
|
||||
|
|
@ -4650,7 +4650,7 @@ bool CMinecraftApp::DefaultCapeExists() {
|
|||
bool val = false;
|
||||
|
||||
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;
|
||||
LeaveCriticalSection(&csMemFilesLock);
|
||||
|
||||
|
|
@ -4661,7 +4661,7 @@ bool CMinecraftApp::IsFileInMemoryTextures(const std::wstring& wName) {
|
|||
bool val = false;
|
||||
|
||||
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;
|
||||
LeaveCriticalSection(&csMemFilesLock);
|
||||
|
||||
|
|
@ -4672,7 +4672,7 @@ void CMinecraftApp::GetMemFileDetails(const std::wstring& wName,
|
|||
std::uint8_t** ppbData,
|
||||
unsigned int* pByteCount) {
|
||||
EnterCriticalSection(&csMemFilesLock);
|
||||
AUTO_VAR(it, m_MEM_Files.find(wName));
|
||||
auto it = m_MEM_Files.find(wName);
|
||||
if (it != m_MEM_Files.end()) {
|
||||
PMEMDATA pData = (*it).second;
|
||||
*ppbData = pData->pbData;
|
||||
|
|
@ -4686,7 +4686,7 @@ void CMinecraftApp::AddMemoryTPDFile(int iConfig, std::uint8_t* pbData,
|
|||
EnterCriticalSection(&csMemTPDLock);
|
||||
// check it's not already in
|
||||
PMEMDATA pData = NULL;
|
||||
AUTO_VAR(it, m_MEM_TPD.find(iConfig));
|
||||
auto it = m_MEM_TPD.find(iConfig);
|
||||
if (it == m_MEM_TPD.end()) {
|
||||
pData = new MEMDATA();
|
||||
pData->pbData = pbData;
|
||||
|
|
@ -4703,7 +4703,7 @@ void CMinecraftApp::RemoveMemoryTPDFile(int iConfig) {
|
|||
EnterCriticalSection(&csMemTPDLock);
|
||||
// check it's not already in
|
||||
PMEMDATA pData = NULL;
|
||||
AUTO_VAR(it, m_MEM_TPD.find(iConfig));
|
||||
auto it = m_MEM_TPD.find(iConfig);
|
||||
if (it != m_MEM_TPD.end()) {
|
||||
pData = m_MEM_TPD[iConfig];
|
||||
delete pData;
|
||||
|
|
@ -4720,7 +4720,7 @@ bool CMinecraftApp::IsFileInTPD(int iConfig) {
|
|||
bool val = false;
|
||||
|
||||
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;
|
||||
LeaveCriticalSection(&csMemTPDLock);
|
||||
|
||||
|
|
@ -4730,7 +4730,7 @@ bool CMinecraftApp::IsFileInTPD(int iConfig) {
|
|||
void CMinecraftApp::GetTPD(int iConfig, std::uint8_t** ppbData,
|
||||
unsigned int* pByteCount) {
|
||||
EnterCriticalSection(&csMemTPDLock);
|
||||
AUTO_VAR(it, m_MEM_TPD.find(iConfig));
|
||||
auto it = m_MEM_TPD.find(iConfig);
|
||||
if (it != m_MEM_TPD.end()) {
|
||||
PMEMDATA pData = (*it).second;
|
||||
*ppbData = pData->pbData;
|
||||
|
|
@ -5610,7 +5610,7 @@ HRESULT CMinecraftApp::RegisterDLCData(char* pchDLCName,
|
|||
|
||||
bool CMinecraftApp::GetDLCFullOfferIDForSkinID(const std::wstring& FirstSkin,
|
||||
ULONGLONG* pullVal) {
|
||||
AUTO_VAR(it, DLCInfo_SkinName.find(FirstSkin));
|
||||
auto it = DLCInfo_SkinName.find(FirstSkin);
|
||||
if (it == DLCInfo_SkinName.end()) {
|
||||
return false;
|
||||
} else {
|
||||
|
|
@ -5620,7 +5620,7 @@ bool CMinecraftApp::GetDLCFullOfferIDForSkinID(const std::wstring& FirstSkin,
|
|||
}
|
||||
bool CMinecraftApp::GetDLCFullOfferIDForPackID(const int iPackID,
|
||||
ULONGLONG* pullVal) {
|
||||
AUTO_VAR(it, DLCTextures_PackID.find(iPackID));
|
||||
auto it = DLCTextures_PackID.find(iPackID);
|
||||
if (it == DLCTextures_PackID.end()) {
|
||||
*pullVal = (ULONGLONG)0;
|
||||
return false;
|
||||
|
|
@ -5632,7 +5632,7 @@ bool CMinecraftApp::GetDLCFullOfferIDForPackID(const int iPackID,
|
|||
DLC_INFO* CMinecraftApp::GetDLCInfoForTrialOfferID(ULONGLONG ullOfferID_Trial) {
|
||||
// DLC_INFO *pDLCInfo=NULL;
|
||||
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()) {
|
||||
// nothing for this
|
||||
|
|
@ -5678,7 +5678,7 @@ ULONGLONG CMinecraftApp::GetDLCInfoTexturesFullOffer(int iIndex) {
|
|||
|
||||
DLC_INFO* CMinecraftApp::GetDLCInfoForFullOfferID(ULONGLONG ullOfferID_Full) {
|
||||
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()) {
|
||||
// nothing for this
|
||||
|
|
@ -5857,7 +5857,7 @@ void CMinecraftApp::AddLevelToBannedLevelList(int iPad, PlayerUID xuid,
|
|||
static_cast<unsigned int>(sizeof(BANNEDLISTDATA) * bannedListCount);
|
||||
PBANNEDLISTDATA pBannedList = new BANNEDLISTDATA[bannedListCount];
|
||||
int iCount = 0;
|
||||
for (AUTO_VAR(it, m_vBannedListA[iPad]->begin());
|
||||
for (auto it = m_vBannedListA[iPad]->begin();
|
||||
it != m_vBannedListA[iPad]->end(); ++it) {
|
||||
PBANNEDLISTDATA pData = *it;
|
||||
memcpy(&pBannedList[iCount++], pData, sizeof(BANNEDLISTDATA));
|
||||
|
|
@ -5876,7 +5876,7 @@ void CMinecraftApp::AddLevelToBannedLevelList(int iPad, PlayerUID xuid,
|
|||
|
||||
bool CMinecraftApp::IsInBannedLevelList(int iPad, PlayerUID xuid,
|
||||
char* pszLevelName) {
|
||||
for (AUTO_VAR(it, m_vBannedListA[iPad]->begin());
|
||||
for (auto it = m_vBannedListA[iPad]->begin();
|
||||
it != m_vBannedListA[iPad]->end(); ++it) {
|
||||
PBANNEDLISTDATA pData = *it;
|
||||
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
|
||||
// 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();) {
|
||||
PBANNEDLISTDATA pBannedListData = *it;
|
||||
|
||||
|
|
@ -6507,7 +6507,7 @@ unsigned int CMinecraftApp::CreateImageTextData(std::uint8_t* textMetadata,
|
|||
void CMinecraftApp::AddTerrainFeaturePosition(_eTerrainFeatureType eFeatureType,
|
||||
int x, int z) {
|
||||
// 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) {
|
||||
FEATURE_DATA* pFeatureData = *it;
|
||||
|
||||
|
|
@ -6525,7 +6525,7 @@ void CMinecraftApp::AddTerrainFeaturePosition(_eTerrainFeatureType eFeatureType,
|
|||
}
|
||||
|
||||
_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) {
|
||||
FEATURE_DATA* pFeatureData = *it;
|
||||
|
||||
|
|
@ -6538,7 +6538,7 @@ _eTerrainFeatureType CMinecraftApp::IsTerrainFeature(int x, int z) {
|
|||
|
||||
bool CMinecraftApp::GetTerrainFeaturePosition(_eTerrainFeatureType eType,
|
||||
int* pX, int* pZ) {
|
||||
for (AUTO_VAR(it, m_vTerrainFeatures.begin());
|
||||
for (auto it = m_vTerrainFeatures.begin();
|
||||
it < m_vTerrainFeatures.end(); ++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
|
||||
int iPosition = 0;
|
||||
for (AUTO_VAR(it, m_DLCDownloadQueue.begin());
|
||||
for (auto it = m_DLCDownloadQueue.begin();
|
||||
it != m_DLCDownloadQueue.end(); ++it) {
|
||||
DLCRequest* pCurrent = *it;
|
||||
|
||||
|
|
@ -6717,7 +6717,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType,
|
|||
bool bPromoted=false;
|
||||
|
||||
|
||||
for(AUTO_VAR(it, m_TMSPPDownloadQueue.begin()); it !=
|
||||
for(auto it = m_TMSPPDownloadQueue.begin(); it !=
|
||||
m_TMSPPDownloadQueue.end(); ++it)
|
||||
{
|
||||
TMSPPRequest *pCurrent = *it;
|
||||
|
|
@ -6776,7 +6776,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType,
|
|||
// of a previous trial/full offer
|
||||
|
||||
bool bAlreadyInQueue = false;
|
||||
for (AUTO_VAR(it, m_TMSPPDownloadQueue.begin());
|
||||
for (auto it = m_TMSPPDownloadQueue.begin();
|
||||
it != m_TMSPPDownloadQueue.end(); ++it) {
|
||||
TMSPPRequest* pCurrent = *it;
|
||||
|
||||
|
|
@ -6843,7 +6843,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType,
|
|||
// a previous trial/full offer
|
||||
|
||||
bool bAlreadyInQueue = false;
|
||||
for (AUTO_VAR(it, m_TMSPPDownloadQueue.begin());
|
||||
for (auto it = m_TMSPPDownloadQueue.begin();
|
||||
it != m_TMSPPDownloadQueue.end(); ++it) {
|
||||
TMSPPRequest* pCurrent = *it;
|
||||
|
||||
|
|
@ -6895,7 +6895,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType,
|
|||
|
||||
bool CMinecraftApp::CheckTMSDLCCanStop() {
|
||||
EnterCriticalSection(&csTMSPPDownloadQueue);
|
||||
for (AUTO_VAR(it, m_TMSPPDownloadQueue.begin());
|
||||
for (auto it = m_TMSPPDownloadQueue.begin();
|
||||
it != m_TMSPPDownloadQueue.end(); ++it) {
|
||||
TMSPPRequest* pCurrent = *it;
|
||||
|
||||
|
|
@ -6921,7 +6921,7 @@ bool CMinecraftApp::RetrieveNextDLCContent() {
|
|||
}
|
||||
|
||||
EnterCriticalSection(&csDLCDownloadQueue);
|
||||
for (AUTO_VAR(it, m_DLCDownloadQueue.begin());
|
||||
for (auto it = m_DLCDownloadQueue.begin();
|
||||
it != m_DLCDownloadQueue.end(); ++it) {
|
||||
DLCRequest* pCurrent = *it;
|
||||
|
||||
|
|
@ -6932,7 +6932,7 @@ bool CMinecraftApp::RetrieveNextDLCContent() {
|
|||
}
|
||||
|
||||
// Now look for the next retrieval
|
||||
for (AUTO_VAR(it, m_DLCDownloadQueue.begin());
|
||||
for (auto it = m_DLCDownloadQueue.begin();
|
||||
it != m_DLCDownloadQueue.end(); ++it) {
|
||||
DLCRequest* pCurrent = *it;
|
||||
|
||||
|
|
@ -6970,7 +6970,7 @@ int CMinecraftApp::TMSPPFileReturned(void* pParam, int iPad, int iUserData,
|
|||
|
||||
// find the right one in the vector
|
||||
EnterCriticalSection(&pClass->csTMSPPDownloadQueue);
|
||||
for (AUTO_VAR(it, pClass->m_TMSPPDownloadQueue.begin());
|
||||
for (auto it = pClass->m_TMSPPDownloadQueue.begin();
|
||||
it != pClass->m_TMSPPDownloadQueue.end(); ++it) {
|
||||
TMSPPRequest* pCurrent = *it;
|
||||
#if defined(_WINDOWS64)
|
||||
|
|
@ -7030,7 +7030,7 @@ void CMinecraftApp::ClearAndResetDLCDownloadQueue() {
|
|||
|
||||
int iPosition = 0;
|
||||
EnterCriticalSection(&csTMSPPDownloadQueue);
|
||||
for (AUTO_VAR(it, m_DLCDownloadQueue.begin());
|
||||
for (auto it = m_DLCDownloadQueue.begin();
|
||||
it != m_DLCDownloadQueue.end(); ++it) {
|
||||
DLCRequest* pCurrent = *it;
|
||||
|
||||
|
|
@ -7052,7 +7052,7 @@ void CMinecraftApp::TickTMSPPFilesRetrieved() {
|
|||
void CMinecraftApp::ClearTMSPPFilesRetrieved() {
|
||||
int iPosition = 0;
|
||||
EnterCriticalSection(&csTMSPPDownloadQueue);
|
||||
for (AUTO_VAR(it, m_TMSPPDownloadQueue.begin());
|
||||
for (auto it = m_TMSPPDownloadQueue.begin();
|
||||
it != m_TMSPPDownloadQueue.end(); ++it) {
|
||||
TMSPPRequest* pCurrent = *it;
|
||||
|
||||
|
|
@ -7070,7 +7070,7 @@ int CMinecraftApp::DLCOffersReturned(void* pParam, int iOfferC,
|
|||
|
||||
// find the right one in the vector
|
||||
EnterCriticalSection(&pClass->csTMSPPDownloadQueue);
|
||||
for (AUTO_VAR(it, pClass->m_DLCDownloadQueue.begin());
|
||||
for (auto it = pClass->m_DLCDownloadQueue.begin();
|
||||
it != pClass->m_DLCDownloadQueue.end(); ++it) {
|
||||
DLCRequest* pCurrent = *it;
|
||||
|
||||
|
|
@ -7102,7 +7102,7 @@ bool CMinecraftApp::DLCContentRetrieved(eDLCMarketplaceType eType) {
|
|||
// If there's already a retrieve in progress, quit
|
||||
// we may have re-ordered the list, so need to check every item
|
||||
EnterCriticalSection(&csDLCDownloadQueue);
|
||||
for (AUTO_VAR(it, m_DLCDownloadQueue.begin());
|
||||
for (auto it = m_DLCDownloadQueue.begin();
|
||||
it != m_DLCDownloadQueue.end(); ++it) {
|
||||
DLCRequest* pCurrent = *it;
|
||||
|
||||
|
|
@ -7168,7 +7168,7 @@ std::vector<ModelPart*>* CMinecraftApp::SetAdditionalSkinBoxes(
|
|||
dwSkinID & 0x0FFFFFFF);
|
||||
|
||||
// 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) {
|
||||
ModelPart* pModelPart = pModel->AddOrRetrievePart(*it);
|
||||
pvModelPart->push_back(pModelPart);
|
||||
|
|
@ -7192,7 +7192,7 @@ std::vector<ModelPart*>* CMinecraftApp::GetAdditionalModelParts(
|
|||
EnterCriticalSection(&csAdditionalModelParts);
|
||||
std::vector<ModelPart*>* pvModelParts = NULL;
|
||||
if (m_AdditionalModelParts.size() > 0) {
|
||||
AUTO_VAR(it, m_AdditionalModelParts.find(dwSkinID));
|
||||
auto it = m_AdditionalModelParts.find(dwSkinID);
|
||||
if (it != m_AdditionalModelParts.end()) {
|
||||
pvModelParts = (*it).second;
|
||||
}
|
||||
|
|
@ -7207,7 +7207,7 @@ std::vector<SKIN_BOX*>* CMinecraftApp::GetAdditionalSkinBoxes(
|
|||
EnterCriticalSection(&csAdditionalSkinBoxes);
|
||||
std::vector<SKIN_BOX*>* pvSkinBoxes = NULL;
|
||||
if (m_AdditionalSkinBoxes.size() > 0) {
|
||||
AUTO_VAR(it, m_AdditionalSkinBoxes.find(dwSkinID));
|
||||
auto it = m_AdditionalSkinBoxes.find(dwSkinID);
|
||||
if (it != m_AdditionalSkinBoxes.end()) {
|
||||
pvSkinBoxes = (*it).second;
|
||||
}
|
||||
|
|
@ -7222,7 +7222,7 @@ unsigned int CMinecraftApp::GetAnimOverrideBitmask(std::uint32_t dwSkinID) {
|
|||
unsigned int uiAnimOverrideBitmask = 0L;
|
||||
|
||||
if (m_AnimOverrides.size() > 0) {
|
||||
AUTO_VAR(it, m_AnimOverrides.find(dwSkinID));
|
||||
auto it = m_AnimOverrides.find(dwSkinID);
|
||||
if (it != m_AnimOverrides.end()) {
|
||||
uiAnimOverrideBitmask = (*it).second;
|
||||
}
|
||||
|
|
@ -7238,7 +7238,7 @@ void CMinecraftApp::SetAnimOverrideBitmask(std::uint32_t dwSkinID,
|
|||
EnterCriticalSection(&csAnimOverrideBitmask);
|
||||
|
||||
if (m_AnimOverrides.size() > 0) {
|
||||
AUTO_VAR(it, m_AnimOverrides.find(dwSkinID));
|
||||
auto it = m_AnimOverrides.find(dwSkinID);
|
||||
if (it != m_AnimOverrides.end()) {
|
||||
LeaveCriticalSection(&csAnimOverrideBitmask);
|
||||
return; // already in here
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ bool DLCAudioFile::processDLCDataFile(std::uint8_t* pbData,
|
|||
for (unsigned int j = 0; j < uiParameterCount; j++) {
|
||||
// EAudioParameterType paramType = e_AudioParamType_Invalid;
|
||||
|
||||
AUTO_VAR(it, parameterMapping.find(paramBuf.dwType));
|
||||
auto it = parameterMapping.find(paramBuf.dwType);
|
||||
|
||||
if (it != parameterMapping.end()) {
|
||||
addParameter(type, (EAudioParameterType)paramBuf.dwType,
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ 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;
|
||||
delete pack;
|
||||
}
|
||||
|
|
@ -174,7 +174,7 @@ DLCManager::EDLCParameterType DLCManager::getParameterType(
|
|||
unsigned int DLCManager::getPackCount(EDLCType type /*= e_DLCType_All*/) {
|
||||
unsigned int packCount = 0;
|
||||
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;
|
||||
if (pack->getDLCItemsCount(type) > 0) {
|
||||
++packCount;
|
||||
|
|
@ -190,14 +190,14 @@ void DLCManager::addPack(DLCPack* pack) { m_packs.push_back(pack); }
|
|||
|
||||
void DLCManager::removePack(DLCPack* pack) {
|
||||
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);
|
||||
delete pack;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
delete pack;
|
||||
}
|
||||
|
|
@ -206,7 +206,7 @@ void DLCManager::removeAllPacks(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;
|
||||
// update the language
|
||||
pack->UpdateLanguage();
|
||||
|
|
@ -217,7 +217,7 @@ DLCPack* DLCManager::getPack(const std::wstring& name) {
|
|||
DLCPack* pack = NULL;
|
||||
// DWORD currentIndex = 0;
|
||||
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;
|
||||
std::wstring wsName = currentPack->getName();
|
||||
|
||||
|
|
@ -236,7 +236,7 @@ DLCPack* DLCManager::getPack(unsigned int index,
|
|||
if (type != e_DLCType_All) {
|
||||
unsigned int currentIndex = 0;
|
||||
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;
|
||||
if (currentPack->getDLCItemsCount(type) > 0) {
|
||||
if (currentIndex == index) {
|
||||
|
|
@ -271,7 +271,7 @@ unsigned int DLCManager::getPackIndex(DLCPack* pack, bool& found,
|
|||
}
|
||||
if (type != e_DLCType_All) {
|
||||
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;
|
||||
if (thisPack->getDLCItemsCount(type) > 0) {
|
||||
if (thisPack == pack) {
|
||||
|
|
@ -284,7 +284,7 @@ unsigned int DLCManager::getPackIndex(DLCPack* pack, bool& found,
|
|||
}
|
||||
} else {
|
||||
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;
|
||||
if (thisPack == pack) {
|
||||
found = true;
|
||||
|
|
@ -302,7 +302,7 @@ unsigned int DLCManager::getPackIndexContainingSkin(const std::wstring& path,
|
|||
unsigned int foundIndex = 0;
|
||||
found = false;
|
||||
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;
|
||||
if (pack->getDLCItemsCount(e_DLCType_Skin) > 0) {
|
||||
if (pack->doesPackContainSkin(path)) {
|
||||
|
|
@ -318,7 +318,7 @@ unsigned int DLCManager::getPackIndexContainingSkin(const std::wstring& path,
|
|||
|
||||
DLCPack* DLCManager::getPackContainingSkin(const std::wstring& path) {
|
||||
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;
|
||||
if (pack->getDLCItemsCount(e_DLCType_Skin) > 0) {
|
||||
if (pack->doesPackContainSkin(path)) {
|
||||
|
|
@ -332,7 +332,7 @@ DLCPack* DLCManager::getPackContainingSkin(const std::wstring& path) {
|
|||
|
||||
DLCSkinFile* DLCManager::getSkinFile(const std::wstring& path) {
|
||||
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;
|
||||
foundSkinfile = pack->getSkinFile(path);
|
||||
if (foundSkinfile != NULL) {
|
||||
|
|
@ -348,7 +348,7 @@ unsigned int DLCManager::checkForCorruptDLCAndAlert(
|
|||
DLCPack* pack = 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;
|
||||
if (pack->IsCorrupt()) {
|
||||
++corruptDLCCount;
|
||||
|
|
@ -529,7 +529,7 @@ bool DLCManager::processDLCDataFile(unsigned int& dwFilesProcessed,
|
|||
// DLCManager::EDLCParameterType paramType =
|
||||
// DLCManager::e_DLCParamType_Invalid;
|
||||
|
||||
AUTO_VAR(it, parameterMapping.find(parBuf.dwType));
|
||||
auto it = parameterMapping.find(parBuf.dwType);
|
||||
|
||||
if (it != parameterMapping.end()) {
|
||||
if (type == e_DLCType_PackConfig) {
|
||||
|
|
@ -686,7 +686,7 @@ std::uint32_t DLCManager::retrievePackID(std::uint8_t* pbData,
|
|||
pbTemp += sizeof(int);
|
||||
ReadDlcStruct(¶mBuf, pbTemp);
|
||||
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 (type == e_DLCType_PackConfig) {
|
||||
|
|
|
|||
|
|
@ -29,12 +29,12 @@ DLCPack::DLCPack(const std::wstring& name, std::uint32_t dwLicenseMask) {
|
|||
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
@ -122,7 +122,7 @@ void DLCPack::addParameter(DLCManager::EDLCParameterType type,
|
|||
|
||||
bool DLCPack::getParameterAsUInt(DLCManager::EDLCParameterType type,
|
||||
unsigned int& param) {
|
||||
AUTO_VAR(it, m_parameters.find((int)type));
|
||||
auto it = m_parameters.find((int)type);
|
||||
if (it != m_parameters.end()) {
|
||||
switch (type) {
|
||||
case DLCManager::e_DLCParamType_NetherParticleColour:
|
||||
|
|
@ -213,8 +213,8 @@ bool DLCPack::doesPackContainFile(DLCManager::EDLCType type,
|
|||
}
|
||||
} else {
|
||||
g_pathCmpString = &path;
|
||||
AUTO_VAR(it, std::find_if(m_files[type].begin(), m_files[type].end(),
|
||||
pathCmp));
|
||||
auto it = std::find_if(m_files[type].begin(), m_files[type].end(),
|
||||
pathCmp);
|
||||
hasFile = it != m_files[type].end();
|
||||
if (!hasFile && m_parentPack) {
|
||||
hasFile = m_parentPack->doesPackContainFile(type, path);
|
||||
|
|
@ -252,8 +252,7 @@ DLCFile* DLCPack::getFile(DLCManager::EDLCType type, const std::wstring& path) {
|
|||
}
|
||||
} else {
|
||||
g_pathCmpString = &path;
|
||||
AUTO_VAR(it, std::find_if(m_files[type].begin(), m_files[type].end(),
|
||||
pathCmp));
|
||||
auto it = std::find_if(m_files[type].begin(), m_files[type].end(), pathCmp);
|
||||
|
||||
if (it == m_files[type].end()) {
|
||||
// Not found
|
||||
|
|
@ -298,7 +297,7 @@ unsigned int DLCPack::getFileIndexAt(DLCManager::EDLCType type,
|
|||
unsigned int foundIndex = 0;
|
||||
found = false;
|
||||
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) {
|
||||
foundIndex = index;
|
||||
found = true;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ void AddItemRuleDefinition::writeAttributes(DataOutputStream* dos,
|
|||
void AddItemRuleDefinition::getChildren(
|
||||
std::vector<GameRuleDefinition*>* 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);
|
||||
}
|
||||
|
||||
|
|
@ -95,7 +95,7 @@ bool AddItemRuleDefinition::addItemToContainer(
|
|||
new ItemInstance(m_itemId, quantity, m_auxValue));
|
||||
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)->enchantItem(newItem);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ bool CompleteAllRuleDefinition::onCollectItem(
|
|||
void CompleteAllRuleDefinition::updateStatus(GameRule* rule) {
|
||||
int goal = 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) {
|
||||
if (it->second.isPointer) {
|
||||
goal += it->second.gr->getGameRuleDefinition()->getGoal();
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ 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);
|
||||
}
|
||||
}
|
||||
|
|
@ -17,7 +17,7 @@ CompoundGameRuleDefinition::~CompoundGameRuleDefinition() {
|
|||
void CompoundGameRuleDefinition::getChildren(
|
||||
std::vector<GameRuleDefinition*>* 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);
|
||||
}
|
||||
|
||||
|
|
@ -48,7 +48,7 @@ void CompoundGameRuleDefinition::populateGameRule(
|
|||
GameRulesInstance::EGameRulesInstanceType type, GameRule* rule) {
|
||||
GameRule* newRule = NULL;
|
||||
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());
|
||||
(*it)->populateGameRule(type, newRule);
|
||||
|
||||
|
|
@ -66,7 +66,7 @@ void CompoundGameRuleDefinition::populateGameRule(
|
|||
bool CompoundGameRuleDefinition::onUseTile(GameRule* rule, int tileId, int x,
|
||||
int y, int z) {
|
||||
bool statusChanged = false;
|
||||
for (AUTO_VAR(it, rule->m_parameters.begin());
|
||||
for (auto it = rule->m_parameters.begin();
|
||||
it != rule->m_parameters.end(); ++it) {
|
||||
if (it->second.isPointer) {
|
||||
bool changed = it->second.gr->getGameRuleDefinition()->onUseTile(
|
||||
|
|
@ -84,7 +84,7 @@ bool CompoundGameRuleDefinition::onUseTile(GameRule* rule, int tileId, int x,
|
|||
bool CompoundGameRuleDefinition::onCollectItem(
|
||||
GameRule* rule, std::shared_ptr<ItemInstance> item) {
|
||||
bool statusChanged = false;
|
||||
for (AUTO_VAR(it, rule->m_parameters.begin());
|
||||
for (auto it = rule->m_parameters.begin();
|
||||
it != rule->m_parameters.end(); ++it) {
|
||||
if (it->second.isPointer) {
|
||||
bool changed =
|
||||
|
|
@ -102,7 +102,7 @@ bool CompoundGameRuleDefinition::onCollectItem(
|
|||
|
||||
void CompoundGameRuleDefinition::postProcessPlayer(
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
@ -18,7 +18,7 @@ void ConsoleGenerateStructure::getChildren(
|
|||
std::vector<GameRuleDefinition*>* 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);
|
||||
}
|
||||
|
||||
|
|
@ -104,7 +104,7 @@ BoundingBox* ConsoleGenerateStructure::getBoundingBox() {
|
|||
// Find the max bounds
|
||||
int maxX, maxY, maxZ;
|
||||
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;
|
||||
maxX = std::max(maxX, action->getEndX());
|
||||
maxY = std::max(maxY, action->getEndY());
|
||||
|
|
@ -121,7 +121,7 @@ bool ConsoleGenerateStructure::postProcess(Level* level, Random* random,
|
|||
BoundingBox* chunkBB) {
|
||||
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;
|
||||
|
||||
switch (action->getActionType()) {
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ void ConsoleSchematicFile::save_tags(DataOutputStream* dos) {
|
|||
ListTag<CompoundTag>* tileEntityTags = new ListTag<CompoundTag>();
|
||||
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++) {
|
||||
CompoundTag* cTag = new CompoundTag();
|
||||
(*it)->save(cTag);
|
||||
|
|
@ -179,7 +179,7 @@ void ConsoleSchematicFile::save_tags(DataOutputStream* dos) {
|
|||
ListTag<CompoundTag>* entityTags = new ListTag<CompoundTag>();
|
||||
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());
|
||||
|
||||
NbtIo::write(tag, dos);
|
||||
|
|
@ -452,7 +452,7 @@ void ConsoleSchematicFile::schematicCoordToChunkCoord(
|
|||
void ConsoleSchematicFile::applyTileEntities(LevelChunk* chunk, AABB* chunkBox,
|
||||
AABB* destinationBox,
|
||||
ESchematicRotation rot) {
|
||||
for (AUTO_VAR(it, m_tileEntities.begin()); it != m_tileEntities.end();
|
||||
for (auto it = m_tileEntities.begin(); it != m_tileEntities.end();
|
||||
++it) {
|
||||
std::shared_ptr<TileEntity> te = *it;
|
||||
|
||||
|
|
@ -499,7 +499,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk* chunk, AABB* chunkBox,
|
|||
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;
|
||||
|
||||
double targetX = source.x;
|
||||
|
|
@ -714,7 +714,7 @@ void ConsoleSchematicFile::generateSchematicFile(
|
|||
getTileEntitiesInRegion(level->getChunk(xc, zc), xStart, yStart,
|
||||
zStart, xStart + xSize, yStart + ySize,
|
||||
zStart + zSize);
|
||||
for (AUTO_VAR(it, tileEntities->begin()); it != tileEntities->end();
|
||||
for (auto it = tileEntities->begin(); it != tileEntities->end();
|
||||
++it) {
|
||||
std::shared_ptr<TileEntity> te = *it;
|
||||
CompoundTag* teTag = new CompoundTag();
|
||||
|
|
@ -738,7 +738,7 @@ void ConsoleSchematicFile::generateSchematicFile(
|
|||
level->getEntities(nullptr, &bb);
|
||||
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;
|
||||
|
||||
bool mobCanBeSaved = false;
|
||||
|
|
@ -1070,7 +1070,7 @@ ConsoleSchematicFile::getTileEntitiesInRegion(LevelChunk* chunk, int x0, int y0,
|
|||
int z0, int x1, int y1, int z1) {
|
||||
std::vector<std::shared_ptr<TileEntity> >* result =
|
||||
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) {
|
||||
std::shared_ptr<TileEntity> te = it->second;
|
||||
if (te->x >= x0 && te->y >= y0 && te->z >= z0 && te->x < x1 &&
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ GameRule::GameRule(GameRuleDefinition* definition, Connection* connection) {
|
|||
}
|
||||
|
||||
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) {
|
||||
delete it->second.gr;
|
||||
}
|
||||
|
|
@ -51,7 +51,7 @@ void GameRule::onCollectItem(std::shared_ptr<ItemInstance> item) {
|
|||
void GameRule::write(DataOutputStream* dos) {
|
||||
// Find required parameters.
|
||||
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;
|
||||
ValueType vType = (*it).second;
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ void GameRuleDefinition::write(DataOutputStream* dos) {
|
|||
|
||||
// Write children.
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
@ -119,7 +119,7 @@ GameRuleDefinition::enumerateMap() {
|
|||
|
||||
int i = 0;
|
||||
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++));
|
||||
|
||||
return out;
|
||||
|
|
|
|||
|
|
@ -348,7 +348,7 @@ void GameRuleManager::writeRuleFile(DataOutputStream* dos) {
|
|||
std::unordered_map<std::wstring, ConsoleSchematicFile*>* files;
|
||||
files = getLevelGenerationOptions()->getUnfinishedSchematicFiles();
|
||||
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;
|
||||
ConsoleSchematicFile* file = it->second;
|
||||
|
||||
|
|
@ -528,7 +528,7 @@ bool GameRuleManager::readRuleFile(
|
|||
int tagId = contentDis->readInt();
|
||||
ConsoleGameRules::EGameRuleType tagVal =
|
||||
ConsoleGameRules::eGameRuleType_Invalid;
|
||||
AUTO_VAR(it, tagIdMap.find(tagId));
|
||||
auto it = tagIdMap.find(tagId);
|
||||
if (it != tagIdMap.end()) tagVal = it->second;
|
||||
|
||||
GameRuleDefinition* rule = NULL;
|
||||
|
|
@ -601,7 +601,7 @@ void GameRuleManager::readChildren(
|
|||
int tagId = dis->readInt();
|
||||
ConsoleGameRules::EGameRuleType tagVal =
|
||||
ConsoleGameRules::eGameRuleType_Invalid;
|
||||
AUTO_VAR(it, tagIdMap->find(tagId));
|
||||
auto it = tagIdMap->find(tagId);
|
||||
if (it != tagIdMap->end()) tagVal = it->second;
|
||||
|
||||
GameRuleDefinition* childRule = NULL;
|
||||
|
|
|
|||
|
|
@ -74,21 +74,21 @@ LevelGenerationOptions::LevelGenerationOptions(DLCPack* parentPack) {
|
|||
LevelGenerationOptions::~LevelGenerationOptions() {
|
||||
clearSchematics();
|
||||
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) {
|
||||
delete *it;
|
||||
}
|
||||
for (AUTO_VAR(it, m_structureRules.begin()); it != m_structureRules.end();
|
||||
for (auto it = m_structureRules.begin(); it != m_structureRules.end();
|
||||
++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) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
@ -124,20 +124,20 @@ void LevelGenerationOptions::getChildren(
|
|||
GameRuleDefinition::getChildren(children);
|
||||
|
||||
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++)
|
||||
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++)
|
||||
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++)
|
||||
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)
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
@ -255,7 +255,7 @@ void LevelGenerationOptions::processSchematics(LevelChunk* chunk) {
|
|||
chunk->z);
|
||||
AABB chunkBox(chunk->x * 16, 0, chunk->z * 16, chunk->x * 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) {
|
||||
ApplySchematicRuleDefinition* rule = *it;
|
||||
rule->processSchematic(&chunkBox, chunk);
|
||||
|
|
@ -264,7 +264,7 @@ void LevelGenerationOptions::processSchematics(LevelChunk* chunk) {
|
|||
int cx = (chunk->x << 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++) {
|
||||
ConsoleGenerateStructure* structureStart = *it;
|
||||
|
||||
|
|
@ -283,7 +283,7 @@ void LevelGenerationOptions::processSchematicsLighting(LevelChunk* chunk) {
|
|||
chunk->x, chunk->z);
|
||||
AABB chunkBox(chunk->x * 16, 0, chunk->z * 16, chunk->x * 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) {
|
||||
ApplySchematicRuleDefinition* rule = *it;
|
||||
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
|
||||
if (!m_bHaveMinY) {
|
||||
for (AUTO_VAR(it, m_schematicRules.begin());
|
||||
for (auto it = m_schematicRules.begin();
|
||||
it != m_schematicRules.end(); ++it) {
|
||||
ApplySchematicRuleDefinition* rule = *it;
|
||||
int minY = rule->getMinY();
|
||||
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++) {
|
||||
ConsoleGenerateStructure* structureStart = *it;
|
||||
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;
|
||||
|
||||
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) {
|
||||
ApplySchematicRuleDefinition* rule = *it;
|
||||
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) {
|
||||
for (AUTO_VAR(it, m_structureRules.begin());
|
||||
for (auto it = m_structureRules.begin();
|
||||
it != m_structureRules.end(); it++) {
|
||||
ConsoleGenerateStructure* structureStart = *it;
|
||||
intersects =
|
||||
|
|
@ -343,7 +343,7 @@ bool LevelGenerationOptions::checkIntersects(int x0, int y0, int z0, int x1,
|
|||
}
|
||||
|
||||
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;
|
||||
}
|
||||
m_schematics.clear();
|
||||
|
|
@ -353,7 +353,7 @@ ConsoleSchematicFile* LevelGenerationOptions::loadSchematicFile(
|
|||
const std::wstring& filename, std::uint8_t* pbData,
|
||||
unsigned int dataLength) {
|
||||
// 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 !defined(_CONTENT_PACKAGE)
|
||||
wprintf(L"We have already loaded schematic file %ls\n",
|
||||
|
|
@ -378,7 +378,7 @@ ConsoleSchematicFile* LevelGenerationOptions::getSchematicFile(
|
|||
const std::wstring& filename) {
|
||||
ConsoleSchematicFile* schematic = NULL;
|
||||
// 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()) {
|
||||
schematic = it->second;
|
||||
}
|
||||
|
|
@ -389,7 +389,7 @@ void LevelGenerationOptions::releaseSchematicFile(
|
|||
const std::wstring& filename) {
|
||||
// 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
|
||||
// AUTO_VAR(it, m_schematics.find(filename));
|
||||
// auto it = m_schematics.find(filename);
|
||||
// if(it != m_schematics.end())
|
||||
//{
|
||||
// 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,
|
||||
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) {
|
||||
BiomeOverride* bo = *it;
|
||||
if (bo->isBiome(biomeId)) {
|
||||
|
|
@ -431,7 +431,7 @@ bool LevelGenerationOptions::isFeatureChunk(
|
|||
int* orientation) {
|
||||
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;
|
||||
if (sf->isFeatureChunk(chunkX, chunkZ, feature, orientation)) {
|
||||
isFeature = true;
|
||||
|
|
@ -446,14 +446,14 @@ LevelGenerationOptions::getUnfinishedSchematicFiles() {
|
|||
// Clean schematic rules.
|
||||
std::unordered_set<std::wstring> usedFiles =
|
||||
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++)
|
||||
if (!(*it)->isComplete()) usedFiles.insert((*it)->getSchematicName());
|
||||
|
||||
// Clean schematic files.
|
||||
std::unordered_map<std::wstring, ConsoleSchematicFile*>* out =
|
||||
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*>(
|
||||
*it, getSchematicFile(*it)));
|
||||
|
||||
|
|
@ -624,7 +624,7 @@ int LevelGenerationOptions::packMounted(LPVOID pParam, int iPad, DWORD dwErr,
|
|||
}
|
||||
|
||||
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)->reset();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,14 +7,14 @@
|
|||
LevelRuleset::LevelRuleset() { m_stringTable = NULL; }
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
void LevelRuleset::getChildren(std::vector<GameRuleDefinition*>* 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);
|
||||
}
|
||||
|
||||
|
|
@ -44,7 +44,7 @@ const wchar_t* LevelRuleset::getString(const std::wstring& key) {
|
|||
|
||||
AABB* LevelRuleset::getNamedArea(const std::wstring& areaName) {
|
||||
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) {
|
||||
area = (*it)->getArea();
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ 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;
|
||||
}
|
||||
}
|
||||
|
|
@ -54,7 +54,7 @@ void UpdatePlayerRuleDefinition::writeAttributes(DataOutputStream* dos,
|
|||
void UpdatePlayerRuleDefinition::getChildren(
|
||||
std::vector<GameRuleDefinition*>* 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);
|
||||
}
|
||||
|
||||
|
|
@ -147,7 +147,7 @@ void UpdatePlayerRuleDefinition::postProcessPlayer(
|
|||
if (m_spawnPos != NULL || m_bUpdateYRot)
|
||||
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;
|
||||
|
||||
addItem->addItemToContainer(player->inventory, -1);
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ 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;
|
||||
}
|
||||
}
|
||||
|
|
@ -24,7 +24,7 @@ XboxStructureActionPlaceContainer::~XboxStructureActionPlaceContainer() {
|
|||
void XboxStructureActionPlaceContainer::getChildren(
|
||||
std::vector<GameRuleDefinition*>* 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);
|
||||
}
|
||||
|
||||
|
|
@ -88,7 +88,7 @@ bool XboxStructureActionPlaceContainer::placeContainerInLevel(
|
|||
Tile::UPDATE_CLIENTS);
|
||||
// Add items
|
||||
int slotId = 0;
|
||||
for (AUTO_VAR(it, m_items.begin());
|
||||
for (auto it = m_items.begin();
|
||||
it != m_items.end() &&
|
||||
(slotId < container->getContainerSize());
|
||||
++it, ++slotId) {
|
||||
|
|
|
|||
|
|
@ -444,7 +444,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft* minecraft,
|
|||
do {
|
||||
// We need to keep ticking the connections for players that
|
||||
// already logged in
|
||||
for (AUTO_VAR(it, createdConnections.begin());
|
||||
for (auto it = createdConnections.begin();
|
||||
it < createdConnections.end(); ++it) {
|
||||
(*it)->tick();
|
||||
}
|
||||
|
|
@ -482,8 +482,8 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft* minecraft,
|
|||
idx, CONTEXT_PRESENCE_MULTIPLAYER, false);
|
||||
} else {
|
||||
connection->close();
|
||||
AUTO_VAR(it, find(createdConnections.begin(),
|
||||
createdConnections.end(), connection));
|
||||
auto it = find(createdConnections.begin(),
|
||||
createdConnections.end(), connection);
|
||||
if (it != createdConnections.end())
|
||||
createdConnections.erase(it);
|
||||
}
|
||||
|
|
@ -497,7 +497,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft* minecraft,
|
|||
}
|
||||
|
||||
if (g_NetworkManager.IsLeavingGame() || !IsInSession()) {
|
||||
for (AUTO_VAR(it, createdConnections.begin());
|
||||
for (auto it = createdConnections.begin();
|
||||
it < createdConnections.end(); ++it) {
|
||||
(*it)->close();
|
||||
}
|
||||
|
|
@ -940,7 +940,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc(void* lpParam) {
|
|||
// them being removed from the server when removed from the session
|
||||
if (pServer != NULL) {
|
||||
PlayerList* players = pServer->getPlayers();
|
||||
for (AUTO_VAR(it, players->players.begin());
|
||||
for (auto it = players->players.begin();
|
||||
it < players->players.end(); ++it) {
|
||||
std::shared_ptr<ServerPlayer> servPlayer = *it;
|
||||
if (servPlayer->connection->isLocal() &&
|
||||
|
|
@ -1005,7 +1005,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc(void* lpParam) {
|
|||
pMinecraft->localplayers[index]->getXuid();
|
||||
|
||||
PlayerList* players = pServer->getPlayers();
|
||||
for (AUTO_VAR(it, players->players.begin());
|
||||
for (auto it = players->players.begin();
|
||||
it < players->players.end(); ++it) {
|
||||
std::shared_ptr<ServerPlayer> servPlayer = *it;
|
||||
if (servPlayer->getXuid() == localPlayerXuid) {
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ void CPlatformNetworkManagerStub::NotifyPlayerJoined(IQNetPlayer* pQNetPlayer) {
|
|||
if (m_pIQNet->IsHost() && !m_bHostChanged) {
|
||||
// Do we already have a primary player for this system?
|
||||
bool systemHasPrimaryPlayer = false;
|
||||
for (AUTO_VAR(it, m_machineQNetPrimaryPlayers.begin());
|
||||
for (auto it = m_machineQNetPrimaryPlayers.begin();
|
||||
it < m_machineQNetPrimaryPlayers.end(); ++it) {
|
||||
IQNetPlayer* pQNetPrimaryPlayer = *it;
|
||||
if (pQNetPlayer->IsSameSystem(pQNetPrimaryPlayer)) {
|
||||
|
|
@ -512,7 +512,7 @@ INetworkPlayer* CPlatformNetworkManagerStub::addNetworkPlayer(
|
|||
void CPlatformNetworkManagerStub::removeNetworkPlayer(
|
||||
IQNetPlayer* pQNetPlayer) {
|
||||
INetworkPlayer* pNetworkPlayer = getNetworkPlayer(pQNetPlayer);
|
||||
for (AUTO_VAR(it, currentNetworkPlayers.begin());
|
||||
for (auto it = currentNetworkPlayers.begin();
|
||||
it != currentNetworkPlayers.end(); it++) {
|
||||
if (*it == pNetworkPlayer) {
|
||||
currentNetworkPlayers.erase(it);
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ bool AreaTask::isCompleted() {
|
|||
switch (m_completionState) {
|
||||
case eAreaTaskCompletion_CompleteOnConstraintsSatisfied: {
|
||||
bool allSatisfied = true;
|
||||
for (AUTO_VAR(it, constraints.begin()); it != constraints.end();
|
||||
for (auto it = constraints.begin(); it != constraints.end();
|
||||
++it) {
|
||||
TutorialConstraint* constraint = *it;
|
||||
if (!constraint->isConstraintSatisfied(tutorial->getPad())) {
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ bool InfoTask::isCompleted() {
|
|||
// If a menu is displayed, then we use the handleUIInput to complete the
|
||||
// task
|
||||
bAllComplete = true;
|
||||
for (AUTO_VAR(it, completedMappings.begin());
|
||||
for (auto it = completedMappings.begin();
|
||||
it != completedMappings.end(); ++it) {
|
||||
bool current = (*it).second;
|
||||
if (!current) {
|
||||
|
|
@ -56,7 +56,7 @@ bool InfoTask::isCompleted() {
|
|||
} else {
|
||||
int iCurrent = 0;
|
||||
|
||||
for (AUTO_VAR(it, completedMappings.begin());
|
||||
for (auto it = completedMappings.begin();
|
||||
it != completedMappings.end(); ++it) {
|
||||
bool current = (*it).second;
|
||||
if (!current) {
|
||||
|
|
@ -94,7 +94,7 @@ void InfoTask::setAsCurrentTask(bool active /*= true*/) {
|
|||
|
||||
void InfoTask::handleUIInput(int iAction) {
|
||||
if (bHasBeenActivated) {
|
||||
for (AUTO_VAR(it, completedMappings.begin());
|
||||
for (auto it = completedMappings.begin();
|
||||
it != completedMappings.end(); ++it) {
|
||||
if (iAction == (*it).first) {
|
||||
(*it).second = true;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#include "ProcedureCompoundTask.h"
|
||||
|
||||
ProcedureCompoundTask::~ProcedureCompoundTask() {
|
||||
for (AUTO_VAR(it, m_taskSequence.begin()); it < m_taskSequence.end();
|
||||
for (auto it = m_taskSequence.begin(); it < m_taskSequence.end();
|
||||
++it) {
|
||||
delete (*it);
|
||||
}
|
||||
|
|
@ -19,8 +19,8 @@ int ProcedureCompoundTask::getDescriptionId() {
|
|||
|
||||
// Return the id of the first task not completed
|
||||
int descriptionId = -1;
|
||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
||||
for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) {
|
||||
auto itEnd = m_taskSequence.end();
|
||||
for (auto it = m_taskSequence.begin(); it < itEnd; ++it) {
|
||||
TutorialTask* task = *it;
|
||||
if (!task->isCompleted()) {
|
||||
task->setAsCurrentTask(true);
|
||||
|
|
@ -40,8 +40,8 @@ int ProcedureCompoundTask::getPromptId() {
|
|||
|
||||
// Return the id of the first task not completed
|
||||
int promptId = -1;
|
||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
||||
for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) {
|
||||
auto itEnd = m_taskSequence.end();
|
||||
for (auto it = m_taskSequence.begin(); it < itEnd; ++it) {
|
||||
TutorialTask* task = *it;
|
||||
if (!task->isCompleted()) {
|
||||
promptId = task->getPromptId();
|
||||
|
|
@ -56,8 +56,8 @@ bool ProcedureCompoundTask::isCompleted() {
|
|||
|
||||
bool allCompleted = true;
|
||||
bool isCurrentTask = true;
|
||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
||||
for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) {
|
||||
auto itEnd = m_taskSequence.end();
|
||||
for (auto it = m_taskSequence.begin(); it < itEnd; ++it) {
|
||||
TutorialTask* task = *it;
|
||||
|
||||
if (allCompleted && isCurrentTask) {
|
||||
|
|
@ -80,7 +80,7 @@ bool ProcedureCompoundTask::isCompleted() {
|
|||
if (allCompleted) {
|
||||
// Disable all constraints
|
||||
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;
|
||||
task->enableConstraints(false);
|
||||
}
|
||||
|
|
@ -90,16 +90,16 @@ bool ProcedureCompoundTask::isCompleted() {
|
|||
}
|
||||
|
||||
void ProcedureCompoundTask::onCrafted(std::shared_ptr<ItemInstance> item) {
|
||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
||||
for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) {
|
||||
auto itEnd = m_taskSequence.end();
|
||||
for (auto it = m_taskSequence.begin(); it < itEnd; ++it) {
|
||||
TutorialTask* task = *it;
|
||||
task->onCrafted(item);
|
||||
}
|
||||
}
|
||||
|
||||
void ProcedureCompoundTask::handleUIInput(int iAction) {
|
||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
||||
for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) {
|
||||
auto itEnd = m_taskSequence.end();
|
||||
for (auto it = m_taskSequence.begin(); it < itEnd; ++it) {
|
||||
TutorialTask* task = *it;
|
||||
task->handleUIInput(iAction);
|
||||
}
|
||||
|
|
@ -107,8 +107,8 @@ void ProcedureCompoundTask::handleUIInput(int iAction) {
|
|||
|
||||
void ProcedureCompoundTask::setAsCurrentTask(bool active /*= true*/) {
|
||||
bool allCompleted = true;
|
||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
||||
for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) {
|
||||
auto itEnd = m_taskSequence.end();
|
||||
for (auto it = m_taskSequence.begin(); it < itEnd; ++it) {
|
||||
TutorialTask* task = *it;
|
||||
if (allCompleted && !task->isCompleted()) {
|
||||
task->setAsCurrentTask(true);
|
||||
|
|
@ -123,8 +123,8 @@ bool ProcedureCompoundTask::ShowMinimumTime() {
|
|||
if (bIsCompleted) return false;
|
||||
|
||||
bool showMinimumTime = false;
|
||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
||||
for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) {
|
||||
auto itEnd = m_taskSequence.end();
|
||||
for (auto it = m_taskSequence.begin(); it < itEnd; ++it) {
|
||||
TutorialTask* task = *it;
|
||||
if (!task->isCompleted()) {
|
||||
showMinimumTime = task->ShowMinimumTime();
|
||||
|
|
@ -138,8 +138,8 @@ bool ProcedureCompoundTask::hasBeenActivated() {
|
|||
if (bIsCompleted) return true;
|
||||
|
||||
bool hasBeenActivated = false;
|
||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
||||
for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) {
|
||||
auto itEnd = m_taskSequence.end();
|
||||
for (auto it = m_taskSequence.begin(); it < itEnd; ++it) {
|
||||
TutorialTask* task = *it;
|
||||
if (!task->isCompleted()) {
|
||||
hasBeenActivated = task->hasBeenActivated();
|
||||
|
|
@ -150,8 +150,8 @@ bool ProcedureCompoundTask::hasBeenActivated() {
|
|||
}
|
||||
|
||||
void ProcedureCompoundTask::setShownForMinimumTime() {
|
||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
||||
for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) {
|
||||
auto itEnd = m_taskSequence.end();
|
||||
for (auto it = m_taskSequence.begin(); it < itEnd; ++it) {
|
||||
TutorialTask* task = *it;
|
||||
if (!task->isCompleted()) {
|
||||
task->setShownForMinimumTime();
|
||||
|
|
@ -164,8 +164,8 @@ bool ProcedureCompoundTask::AllowFade() {
|
|||
if (bIsCompleted) return true;
|
||||
|
||||
bool allowFade = true;
|
||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
||||
for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) {
|
||||
auto itEnd = m_taskSequence.end();
|
||||
for (auto it = m_taskSequence.begin(); it < itEnd; ++it) {
|
||||
TutorialTask* task = *it;
|
||||
if (!task->isCompleted()) {
|
||||
allowFade = task->AllowFade();
|
||||
|
|
@ -178,8 +178,8 @@ bool ProcedureCompoundTask::AllowFade() {
|
|||
void ProcedureCompoundTask::useItemOn(Level* level,
|
||||
std::shared_ptr<ItemInstance> item, int x,
|
||||
int y, int z, bool bTestUseOnly) {
|
||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
||||
for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) {
|
||||
auto itEnd = m_taskSequence.end();
|
||||
for (auto it = m_taskSequence.begin(); it < itEnd; ++it) {
|
||||
TutorialTask* task = *it;
|
||||
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,
|
||||
bool bTestUseOnly) {
|
||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
||||
for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) {
|
||||
auto itEnd = m_taskSequence.end();
|
||||
for (auto it = m_taskSequence.begin(); it < itEnd; ++it) {
|
||||
TutorialTask* task = *it;
|
||||
task->useItem(item, bTestUseOnly);
|
||||
}
|
||||
|
|
@ -197,16 +197,16 @@ void ProcedureCompoundTask::useItem(std::shared_ptr<ItemInstance> item,
|
|||
void ProcedureCompoundTask::onTake(std::shared_ptr<ItemInstance> item,
|
||||
unsigned int invItemCountAnyAux,
|
||||
unsigned int invItemCountThisAux) {
|
||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
||||
for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) {
|
||||
auto itEnd = m_taskSequence.end();
|
||||
for (auto it = m_taskSequence.begin(); it < itEnd; ++it) {
|
||||
TutorialTask* task = *it;
|
||||
task->onTake(item, invItemCountAnyAux, invItemCountThisAux);
|
||||
}
|
||||
}
|
||||
|
||||
void ProcedureCompoundTask::onStateChange(eTutorial_State newState) {
|
||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
||||
for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) {
|
||||
auto itEnd = m_taskSequence.end();
|
||||
for (auto it = m_taskSequence.begin(); it < itEnd; ++it) {
|
||||
TutorialTask* task = *it;
|
||||
task->onStateChange(newState);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1929,7 +1929,7 @@ Tutorial::Tutorial(int iPad, bool isFullTutorial /*= false*/) : m_iPad(iPad) {
|
|||
}
|
||||
|
||||
Tutorial::~Tutorial() {
|
||||
for (AUTO_VAR(it, m_globalConstraints.begin());
|
||||
for (auto it = m_globalConstraints.begin();
|
||||
it != m_globalConstraints.end(); ++it) {
|
||||
delete (*it);
|
||||
}
|
||||
|
|
@ -1939,11 +1939,11 @@ Tutorial::~Tutorial() {
|
|||
delete (*it).second;
|
||||
}
|
||||
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) {
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
@ -1968,7 +1968,7 @@ void Tutorial::setCompleted(int completableId) {
|
|||
// }
|
||||
|
||||
int completableIndex = -1;
|
||||
for (AUTO_VAR(it, s_completableTasks.begin());
|
||||
for (auto it = s_completableTasks.begin();
|
||||
it < s_completableTasks.end(); ++it) {
|
||||
++completableIndex;
|
||||
if (*it == completableId) {
|
||||
|
|
@ -1996,7 +1996,7 @@ bool Tutorial::getCompleted(int completableId) {
|
|||
// }
|
||||
|
||||
int completableIndex = -1;
|
||||
for (AUTO_VAR(it, s_completableTasks.begin());
|
||||
for (auto it = s_completableTasks.begin();
|
||||
it < s_completableTasks.end(); ++it) {
|
||||
++completableIndex;
|
||||
if (*it == completableId) {
|
||||
|
|
@ -2079,7 +2079,7 @@ void Tutorial::tick() {
|
|||
bool taskChanged = false;
|
||||
|
||||
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()) {
|
||||
++(*it).second;
|
||||
if ((*it).second > m_iTutorialConstraintDelayRemoveTicks) {
|
||||
|
|
@ -2152,7 +2152,7 @@ void Tutorial::tick() {
|
|||
}
|
||||
|
||||
// Check constraints
|
||||
for (AUTO_VAR(it, m_globalConstraints.begin());
|
||||
for (auto it = m_globalConstraints.begin();
|
||||
it < m_globalConstraints.end(); ++it) {
|
||||
TutorialConstraint* constraint = *it;
|
||||
constraint->tick(m_iPad);
|
||||
|
|
@ -2167,7 +2167,7 @@ void Tutorial::tick() {
|
|||
m_isFullTutorial || app.GetGameSettings(m_iPad, eGameSetting_Hints);
|
||||
|
||||
if (hintsOn) {
|
||||
for (AUTO_VAR(it, hints[m_CurrentState].begin());
|
||||
for (auto it = hints[m_CurrentState].begin();
|
||||
it < hints[m_CurrentState].end(); ++it) {
|
||||
TutorialHint* hint = *it;
|
||||
hintNeeded = hint->tick();
|
||||
|
|
@ -2195,7 +2195,7 @@ void Tutorial::tick() {
|
|||
constraintChanged = true;
|
||||
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) {
|
||||
TutorialConstraint* constraint = *it;
|
||||
if (!constraint->isConstraintSatisfied(m_iPad) &&
|
||||
|
|
@ -2210,7 +2210,7 @@ void Tutorial::tick() {
|
|||
currentFailedConstraint[m_CurrentState] == NULL) {
|
||||
// Update tasks
|
||||
bool isCurrentTask = true;
|
||||
AUTO_VAR(it, activeTasks[m_CurrentState].begin());
|
||||
auto it = activeTasks[m_CurrentState].begin();
|
||||
while (activeTasks[m_CurrentState].size() > 0 &&
|
||||
it < activeTasks[m_CurrentState].end()) {
|
||||
TutorialTask* task = *it;
|
||||
|
|
@ -2233,9 +2233,9 @@ void Tutorial::tick() {
|
|||
// 4J Stu - Move the delayed constraints to the
|
||||
// gameplay state so that they are in effect for
|
||||
// a bit longer
|
||||
AUTO_VAR(itCon,
|
||||
auto itCon =
|
||||
constraintsToRemove[m_CurrentState]
|
||||
.begin());
|
||||
.begin();
|
||||
while (
|
||||
itCon !=
|
||||
constraintsToRemove[m_CurrentState].end()) {
|
||||
|
|
@ -2259,9 +2259,9 @@ void Tutorial::tick() {
|
|||
}
|
||||
// Fall through the the normal complete state
|
||||
case e_Tutorial_Completion_Complete_State:
|
||||
for (AUTO_VAR(
|
||||
itRem,
|
||||
activeTasks[m_CurrentState].begin());
|
||||
for (auto
|
||||
itRem =
|
||||
activeTasks[m_CurrentState].begin();
|
||||
itRem < activeTasks[m_CurrentState].end();
|
||||
++itRem) {
|
||||
delete (*itRem);
|
||||
|
|
@ -2273,9 +2273,9 @@ void Tutorial::tick() {
|
|||
activeTasks[m_CurrentState].at(
|
||||
activeTasks[m_CurrentState].size() - 1);
|
||||
activeTasks[m_CurrentState].pop_back();
|
||||
for (AUTO_VAR(
|
||||
itRem,
|
||||
activeTasks[m_CurrentState].begin());
|
||||
for (auto
|
||||
itRem =
|
||||
activeTasks[m_CurrentState].begin();
|
||||
itRem < activeTasks[m_CurrentState].end();
|
||||
++itRem) {
|
||||
delete (*itRem);
|
||||
|
|
@ -2433,7 +2433,7 @@ bool Tutorial::setMessage(PopupMessageDetails* message) {
|
|||
if (!message->m_messageString.empty()) {
|
||||
text = message->m_messageString;
|
||||
} else {
|
||||
AUTO_VAR(it, messages.find(message->m_messageId));
|
||||
auto it = messages.find(message->m_messageId);
|
||||
if (it != messages.end() && it->second != NULL) {
|
||||
TutorialMessage* messageString = it->second;
|
||||
text = std::wstring(messageString->getMessageForDisplay());
|
||||
|
|
@ -2457,7 +2457,7 @@ bool Tutorial::setMessage(PopupMessageDetails* message) {
|
|||
if (!message->m_promptString.empty()) {
|
||||
text.append(message->m_promptString);
|
||||
} 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) {
|
||||
TutorialMessage* prompt = it->second;
|
||||
text.append(prompt->getMessageForDisplay());
|
||||
|
|
@ -2555,7 +2555,7 @@ void Tutorial::showTutorialPopup(bool show) {
|
|||
|
||||
void Tutorial::useItemOn(Level* level, std::shared_ptr<ItemInstance> item,
|
||||
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) {
|
||||
TutorialTask* task = *it;
|
||||
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,
|
||||
bool bTestUseOnly) {
|
||||
for (AUTO_VAR(it, activeTasks[m_CurrentState].begin());
|
||||
for (auto it = activeTasks[m_CurrentState].begin();
|
||||
it < activeTasks[m_CurrentState].end(); ++it) {
|
||||
TutorialTask* task = *it;
|
||||
task->useItem(item, bTestUseOnly);
|
||||
|
|
@ -2572,7 +2572,7 @@ void Tutorial::useItemOn(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) {
|
||||
TutorialTask* task = *it;
|
||||
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
|
||||
// while "hunger bar" is full (triggered in split-screen mode)
|
||||
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) {
|
||||
TutorialTask* task = *it;
|
||||
task->completeUsingItem(item);
|
||||
|
|
@ -2592,7 +2592,7 @@ void Tutorial::completeUsingItem(std::shared_ptr<ItemInstance> item) {
|
|||
void Tutorial::startDestroyBlock(std::shared_ptr<ItemInstance> item,
|
||||
Tile* tile) {
|
||||
int hintNeeded = -1;
|
||||
for (AUTO_VAR(it, hints[m_CurrentState].begin());
|
||||
for (auto it = hints[m_CurrentState].begin();
|
||||
it < hints[m_CurrentState].end(); ++it) {
|
||||
TutorialHint* hint = *it;
|
||||
hintNeeded = hint->startDestroyBlock(item, tile);
|
||||
|
|
@ -2607,7 +2607,7 @@ void Tutorial::startDestroyBlock(std::shared_ptr<ItemInstance> item,
|
|||
|
||||
void Tutorial::destroyBlock(Tile* tile) {
|
||||
int hintNeeded = -1;
|
||||
for (AUTO_VAR(it, hints[m_CurrentState].begin());
|
||||
for (auto it = hints[m_CurrentState].begin();
|
||||
it < hints[m_CurrentState].end(); ++it) {
|
||||
TutorialHint* hint = *it;
|
||||
hintNeeded = hint->destroyBlock(tile);
|
||||
|
|
@ -2623,7 +2623,7 @@ void Tutorial::destroyBlock(Tile* tile) {
|
|||
void Tutorial::attack(std::shared_ptr<Player> player,
|
||||
std::shared_ptr<Entity> entity) {
|
||||
int hintNeeded = -1;
|
||||
for (AUTO_VAR(it, hints[m_CurrentState].begin());
|
||||
for (auto it = hints[m_CurrentState].begin();
|
||||
it < hints[m_CurrentState].end(); ++it) {
|
||||
TutorialHint* hint = *it;
|
||||
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) {
|
||||
int hintNeeded = -1;
|
||||
for (AUTO_VAR(it, hints[m_CurrentState].begin());
|
||||
for (auto it = hints[m_CurrentState].begin();
|
||||
it < hints[m_CurrentState].end(); ++it) {
|
||||
TutorialHint* hint = *it;
|
||||
hintNeeded = hint->itemDamaged(item);
|
||||
|
|
@ -2654,7 +2654,7 @@ void Tutorial::itemDamaged(std::shared_ptr<ItemInstance> item) {
|
|||
void Tutorial::handleUIInput(int iAction) {
|
||||
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)
|
||||
//{
|
||||
// TutorialTask *task = *it;
|
||||
|
|
@ -2667,7 +2667,7 @@ void Tutorial::handleUIInput(int iAction) {
|
|||
void Tutorial::createItemSelected(std::shared_ptr<ItemInstance> item,
|
||||
bool canMake) {
|
||||
int hintNeeded = -1;
|
||||
for (AUTO_VAR(it, hints[m_CurrentState].begin());
|
||||
for (auto it = hints[m_CurrentState].begin();
|
||||
it < hints[m_CurrentState].end(); ++it) {
|
||||
TutorialHint* hint = *it;
|
||||
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) {
|
||||
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) {
|
||||
TutorialTask* task = *it;
|
||||
task->onCrafted(item);
|
||||
|
|
@ -2695,7 +2695,7 @@ void Tutorial::onTake(std::shared_ptr<ItemInstance> item,
|
|||
unsigned int invItemCountThisAux) {
|
||||
if (!m_hintDisplayed) {
|
||||
bool hintNeeded = false;
|
||||
for (AUTO_VAR(it, hints[m_CurrentState].begin());
|
||||
for (auto it = hints[m_CurrentState].begin();
|
||||
it < hints[m_CurrentState].end(); ++it) {
|
||||
TutorialHint* hint = *it;
|
||||
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 (AUTO_VAR(it, activeTasks[state].begin());
|
||||
for (auto it = activeTasks[state].begin();
|
||||
it < activeTasks[state].end(); ++it) {
|
||||
TutorialTask* task = *it;
|
||||
task->onTake(item, invItemCountAnyAux, invItemCountThisAux);
|
||||
|
|
@ -2738,7 +2738,7 @@ void Tutorial::onLookAt(int id, int iData) {
|
|||
if (m_hintDisplayed) return;
|
||||
|
||||
bool hintNeeded = false;
|
||||
for (AUTO_VAR(it, hints[m_CurrentState].begin());
|
||||
for (auto it = hints[m_CurrentState].begin();
|
||||
it < hints[m_CurrentState].end(); ++it) {
|
||||
TutorialHint* hint = *it;
|
||||
hintNeeded = hint->onLookAt(id, iData);
|
||||
|
|
@ -2764,7 +2764,7 @@ void Tutorial::onLookAtEntity(std::shared_ptr<Entity> entity) {
|
|||
if (m_hintDisplayed) return;
|
||||
|
||||
bool hintNeeded = false;
|
||||
for (AUTO_VAR(it, hints[m_CurrentState].begin());
|
||||
for (auto it = hints[m_CurrentState].begin();
|
||||
it < hints[m_CurrentState].end(); ++it) {
|
||||
TutorialHint* hint = *it;
|
||||
hintNeeded = hint->onLookAtEntity(entity->GetType());
|
||||
|
|
@ -2778,7 +2778,7 @@ void Tutorial::onLookAtEntity(std::shared_ptr<Entity> entity) {
|
|||
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)->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)->onRideEntity(entity);
|
||||
}
|
||||
}
|
||||
|
||||
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) {
|
||||
TutorialTask* task = *it;
|
||||
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,
|
||||
double yt, double zt) {
|
||||
bool allowed = true;
|
||||
for (AUTO_VAR(it, constraints[m_CurrentState].begin());
|
||||
for (auto it = constraints[m_CurrentState].begin();
|
||||
it < constraints[m_CurrentState].end(); ++it) {
|
||||
TutorialConstraint* constraint = *it;
|
||||
if (!constraint->isConstraintSatisfied(m_iPad) &&
|
||||
|
|
@ -2837,7 +2837,7 @@ bool Tutorial::isInputAllowed(int mapping) {
|
|||
return 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) {
|
||||
TutorialConstraint* constraint = *it;
|
||||
if (constraint->isMappingConstrained(m_iPad, mapping)) {
|
||||
|
|
@ -2852,7 +2852,7 @@ std::vector<TutorialTask*>* Tutorial::getTasks() { return &tasks; }
|
|||
|
||||
unsigned int Tutorial::getCurrentTaskIndex() {
|
||||
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;
|
||||
|
||||
++index;
|
||||
|
|
@ -2875,7 +2875,7 @@ void Tutorial::RemoveConstraint(TutorialConstraint* c,
|
|||
|
||||
if (c->getQueuedForRemoval()) {
|
||||
// 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)
|
||||
{
|
||||
if( it->first == c )
|
||||
|
|
@ -2889,7 +2889,7 @@ void Tutorial::RemoveConstraint(TutorialConstraint* c,
|
|||
constraintsToRemove[m_CurrentState].push_back(
|
||||
std::pair<TutorialConstraint*, unsigned char>(c, 0));
|
||||
} else {
|
||||
for (AUTO_VAR(it, constraintsToRemove[m_CurrentState].begin());
|
||||
for (auto it = constraintsToRemove[m_CurrentState].begin();
|
||||
it < constraintsToRemove[m_CurrentState].end(); ++it) {
|
||||
if (it->first == c) {
|
||||
constraintsToRemove[m_CurrentState].erase(it);
|
||||
|
|
@ -2897,8 +2897,8 @@ void Tutorial::RemoveConstraint(TutorialConstraint* c,
|
|||
}
|
||||
}
|
||||
|
||||
AUTO_VAR(it, find(constraints[m_CurrentState].begin(),
|
||||
constraints[m_CurrentState].end(), c));
|
||||
auto it = find(constraints[m_CurrentState].begin(),
|
||||
constraints[m_CurrentState].end(), c);
|
||||
if (it != constraints[m_CurrentState].end())
|
||||
constraints[m_CurrentState].erase(
|
||||
find(constraints[m_CurrentState].begin(),
|
||||
|
|
@ -2990,7 +2990,7 @@ void Tutorial::changeTutorialState(eTutorial_State newState,
|
|||
m_UIScene = scene;
|
||||
|
||||
if (m_CurrentState != newState) {
|
||||
for (AUTO_VAR(it, activeTasks[newState].begin());
|
||||
for (auto it = activeTasks[newState].begin();
|
||||
it < activeTasks[newState].end(); ++it) {
|
||||
TutorialTask* task = *it;
|
||||
task->onStateChange(newState);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ TutorialTask::TutorialTask(Tutorial* tutorial, int descriptionId,
|
|||
m_bShowMinimumTime(bShowMinimumTime),
|
||||
m_bShownForMinimumTime(false) {
|
||||
if (inConstraints != NULL) {
|
||||
for (AUTO_VAR(it, inConstraints->begin()); it < inConstraints->end();
|
||||
for (auto it = inConstraints->begin(); it < inConstraints->end();
|
||||
++it) {
|
||||
TutorialConstraint* constraint = *it;
|
||||
constraints.push_back(constraint);
|
||||
|
|
@ -34,7 +34,7 @@ TutorialTask::TutorialTask(Tutorial* tutorial, int descriptionId,
|
|||
TutorialTask::~TutorialTask() {
|
||||
enableConstraints(false);
|
||||
|
||||
for (AUTO_VAR(it, constraints.begin()); it < constraints.end(); ++it) {
|
||||
for (auto it = constraints.begin(); it < constraints.end(); ++it) {
|
||||
TutorialConstraint* constraint = *it;
|
||||
|
||||
if (constraint->getQueuedForRemoval()) {
|
||||
|
|
@ -53,7 +53,7 @@ void TutorialTask::enableConstraints(bool enable,
|
|||
bool delayRemove /*= false*/) {
|
||||
if (!enable && (areConstraintsEnabled || !delayRemove)) {
|
||||
// Remove
|
||||
for (AUTO_VAR(it, constraints.begin()); it != constraints.end(); ++it) {
|
||||
for (auto it = constraints.begin(); it != constraints.end(); ++it) {
|
||||
TutorialConstraint* constraint = *it;
|
||||
// app.DebugPrintf(">>>>>>>> %i\n", constraints.size());
|
||||
tutorial->RemoveConstraint(constraint, delayRemove);
|
||||
|
|
@ -61,7 +61,7 @@ void TutorialTask::enableConstraints(bool enable,
|
|||
areConstraintsEnabled = false;
|
||||
} else if (!areConstraintsEnabled && enable) {
|
||||
// Add
|
||||
for (AUTO_VAR(it, constraints.begin()); it != constraints.end(); ++it) {
|
||||
for (auto it = constraints.begin(); it != constraints.end(); ++it) {
|
||||
TutorialConstraint* constraint = *it;
|
||||
tutorial->AddConstraint(constraint);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -631,7 +631,7 @@ void IUIScene_CraftingMenu::CheckRecipesAvailable() {
|
|||
Recipy::INGREDIENTS_REQUIRED* pRecipeIngredientsRequired =
|
||||
Recipes::getInstance()->getRecipeIngredientsArray();
|
||||
int iRecipeC = (int)recipes->size();
|
||||
AUTO_VAR(itRecipe, recipes->begin());
|
||||
auto itRecipe = recipes->begin();
|
||||
|
||||
// dump out the recipe products
|
||||
|
||||
|
|
|
|||
|
|
@ -982,8 +982,8 @@ void IUIScene_CreativeMenu::TabSpec::populateMenu(AbstractContainerMenu* menu,
|
|||
|
||||
// Fill the dynamic group
|
||||
if (m_dynamicGroupsCount > 0 && m_dynamicGroupsA != NULL) {
|
||||
for (AUTO_VAR(it,
|
||||
categoryGroups[m_dynamicGroupsA[dynamicIndex]].rbegin());
|
||||
for (auto it=
|
||||
categoryGroups[m_dynamicGroupsA[dynamicIndex]].rbegin();
|
||||
it != categoryGroups[m_dynamicGroupsA[dynamicIndex]].rend() &&
|
||||
lastSlotIndex < MAX_SIZE;
|
||||
++it) {
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ void IUIScene_TradingMenu::updateDisplay() {
|
|||
m_activeOffers.clear();
|
||||
int unfilteredIndex = 0;
|
||||
int firstValidTrade = INT_MAX;
|
||||
for (AUTO_VAR(it, unfilteredOffers->begin());
|
||||
for (auto it = unfilteredOffers->begin();
|
||||
it != unfilteredOffers->end(); ++it) {
|
||||
MerchantRecipe* recipe = *it;
|
||||
if (!recipe->isDeprecated()) {
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ void UIControl_PlayerSkinPreview::render(IggyCustomDrawCallbackRegion* region) {
|
|||
// *pAdditionalModelParts=mob->GetAdditionalModelParts();
|
||||
|
||||
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) {
|
||||
ModelPart* pModelPart = *it;
|
||||
|
||||
|
|
@ -227,7 +227,7 @@ void UIControl_PlayerSkinPreview::render(IggyCustomDrawCallbackRegion* region) {
|
|||
|
||||
// hide the additional parts
|
||||
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) {
|
||||
ModelPart* pModelPart = *it;
|
||||
|
||||
|
|
|
|||
|
|
@ -452,7 +452,7 @@ void UIController::tick() {
|
|||
|
||||
// Clear out the cached movie file data
|
||||
int64_t currentTime = System::currentTimeMillis();
|
||||
for (AUTO_VAR(it, m_cachedMovieData.begin());
|
||||
for (auto it = m_cachedMovieData.begin();
|
||||
it != m_cachedMovieData.end();) {
|
||||
if (it->second.m_expiry < currentTime) {
|
||||
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) {
|
||||
QueuedMessageBoxData* queuedData = *it;
|
||||
ui.NavigateToScene(queuedData->iPad, eUIScene_MessageBox,
|
||||
|
|
@ -682,7 +682,7 @@ void UIController::CleanUpSkinReload() {
|
|||
byteArray UIController::getMovieData(const std::wstring& filename) {
|
||||
// Cache everything we load in the current tick
|
||||
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()) {
|
||||
byteArray baFile = app.getArchiveFile(filename);
|
||||
CachedMovieData cmd;
|
||||
|
|
@ -1095,8 +1095,8 @@ GDrawTexture* RADLINK UIController::TextureSubstitutionCreateCallback(
|
|||
void* user_callback_data, IggyUTF16* texture_name, S32* width, S32* height,
|
||||
void** destroy_callback_data) {
|
||||
UIController* uiController = (UIController*)user_callback_data;
|
||||
AUTO_VAR(it,
|
||||
uiController->m_substitutionTextures.find((wchar_t*)texture_name));
|
||||
auto it =
|
||||
uiController->m_substitutionTextures.find((wchar_t*)texture_name);
|
||||
|
||||
if (it != uiController->m_substitutionTextures.end()) {
|
||||
app.DebugPrintf("Found substitution texture %ls, with %d bytes\n",
|
||||
|
|
@ -1158,7 +1158,7 @@ void UIController::registerSubstitutionTexture(const std::wstring& textureName,
|
|||
|
||||
void UIController::unregisterSubstitutionTexture(
|
||||
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 (deleteData) delete[] it->second.data;
|
||||
|
|
@ -1393,7 +1393,7 @@ size_t UIController::RegisterForCallbackId(UIScene* scene) {
|
|||
|
||||
void UIController::UnregisterCallbackId(size_t id) {
|
||||
EnterCriticalSection(&m_registeredCallbackScenesCS);
|
||||
AUTO_VAR(it, m_registeredCallbackScenes.find(id));
|
||||
auto it = m_registeredCallbackScenes.find(id);
|
||||
if (it != m_registeredCallbackScenes.end()) {
|
||||
m_registeredCallbackScenes.erase(it);
|
||||
}
|
||||
|
|
@ -1402,7 +1402,7 @@ void UIController::UnregisterCallbackId(size_t id) {
|
|||
|
||||
UIScene* UIController::GetSceneFromCallbackId(size_t id) {
|
||||
UIScene* scene = NULL;
|
||||
AUTO_VAR(it, m_registeredCallbackScenes.find(id));
|
||||
auto it = m_registeredCallbackScenes.find(id);
|
||||
if (it != m_registeredCallbackScenes.end()) {
|
||||
scene = it->second;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ void UILayer::tick() {
|
|||
// so we need to make a copy of the scenes that we are going to try and
|
||||
// destroy this tick
|
||||
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++) {
|
||||
UIScene* scene = (*it);
|
||||
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
|
||||
// back to the ones that are still to be deleted. Actually deleting a scene
|
||||
// might also add something back into m_scenesToDelete.
|
||||
for (AUTO_VAR(it, scenesToDeleteCopy.begin());
|
||||
for (auto it = scenesToDeleteCopy.begin();
|
||||
it != scenesToDeleteCopy.end(); it++) {
|
||||
UIScene* scene = (*it);
|
||||
if (scene->isReadyToDelete()) {
|
||||
|
|
@ -45,12 +45,12 @@ void UILayer::tick() {
|
|||
}
|
||||
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();
|
||||
}
|
||||
// Note: reverse iterator, the last element is the top of the stack
|
||||
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()) {
|
||||
//(*it)->tick();
|
||||
UIScene* scene = m_sceneStack[sceneIndex];
|
||||
|
|
@ -63,9 +63,9 @@ void UILayer::tick() {
|
|||
|
||||
void UILayer::render(S32 width, S32 height, C4JRender::eViewportType viewport) {
|
||||
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) {
|
||||
AUTO_VAR(itRef, m_componentRefCount.find((*it)->getSceneType()));
|
||||
auto itRef = m_componentRefCount.find((*it)->getSceneType());
|
||||
if (itRef != m_componentRefCount.end() && itRef->second.second) {
|
||||
if ((*it)->isVisible()) {
|
||||
PIXBeginNamedEvent(0, "Rendering component %d",
|
||||
|
|
@ -125,7 +125,7 @@ bool UILayer::HasFocus(int iPad) {
|
|||
|
||||
bool UILayer::hidesLowerScenes() {
|
||||
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()) {
|
||||
hidesScenes = true;
|
||||
break;
|
||||
|
|
@ -147,16 +147,16 @@ void UILayer::getRenderDimensions(S32& width, S32& height) {
|
|||
}
|
||||
|
||||
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();
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
if (!m_sceneStack.empty()) {
|
||||
|
|
@ -437,7 +437,7 @@ bool UILayer::NavigateBack(int iPad, EUIScene eScene) {
|
|||
}
|
||||
|
||||
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()) {
|
||||
it->second.second = show;
|
||||
return;
|
||||
|
|
@ -447,7 +447,7 @@ void UILayer::showComponent(int iPad, EUIScene scene, bool show) {
|
|||
|
||||
bool UILayer::isComponentVisible(EUIScene scene) {
|
||||
bool visible = false;
|
||||
AUTO_VAR(it, m_componentRefCount.find(scene));
|
||||
auto it = m_componentRefCount.find(scene);
|
||||
if (it != m_componentRefCount.end()) {
|
||||
visible = it->second.second;
|
||||
}
|
||||
|
|
@ -455,11 +455,11 @@ bool UILayer::isComponentVisible(EUIScene scene) {
|
|||
}
|
||||
|
||||
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()) {
|
||||
++it->second.first;
|
||||
|
||||
for (AUTO_VAR(itComp, m_components.begin());
|
||||
for (auto itComp = m_components.begin();
|
||||
itComp != m_components.end(); ++itComp) {
|
||||
if ((*itComp)->getSceneType() == scene) {
|
||||
return *itComp;
|
||||
|
|
@ -525,13 +525,13 @@ UIScene* UILayer::addComponent(int iPad, EUIScene scene, void* initData) {
|
|||
}
|
||||
|
||||
void UILayer::removeComponent(EUIScene scene) {
|
||||
AUTO_VAR(it, m_componentRefCount.find(scene));
|
||||
auto it = m_componentRefCount.find(scene);
|
||||
if (it != m_componentRefCount.end()) {
|
||||
--it->second.first;
|
||||
|
||||
if (it->second.first <= 0) {
|
||||
m_componentRefCount.erase(it);
|
||||
for (AUTO_VAR(compIt, m_components.begin());
|
||||
for (auto compIt = m_components.begin();
|
||||
compIt != m_components.end();) {
|
||||
if ((*compIt)->getSceneType() == scene) {
|
||||
m_scenesToDelete.push_back((*compIt));
|
||||
|
|
@ -548,8 +548,8 @@ void UILayer::removeComponent(EUIScene scene) {
|
|||
|
||||
void UILayer::removeScene(UIScene* scene) {
|
||||
|
||||
AUTO_VAR(newEnd,
|
||||
std::remove(m_sceneStack.begin(), m_sceneStack.end(), scene));
|
||||
auto newEnd =
|
||||
std::remove(m_sceneStack.begin(), m_sceneStack.end(), scene);
|
||||
m_sceneStack.erase(newEnd, m_sceneStack.end());
|
||||
|
||||
m_scenesToDelete.push_back(scene);
|
||||
|
|
@ -571,7 +571,7 @@ void UILayer::closeAllScenes() {
|
|||
std::vector<UIScene*> temp;
|
||||
temp.insert(temp.end(), m_sceneStack.begin(), m_sceneStack.end());
|
||||
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);
|
||||
(*it)->handleDestroy(); // For anything that might require the pointer
|
||||
// be valid
|
||||
|
|
@ -612,7 +612,7 @@ bool UILayer::updateFocusState(bool allowedFocus /* = false */) {
|
|||
m_bIgnorePlayerJoinMenuDisplayed = 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;
|
||||
|
||||
// UPDATE FOCUS STATES
|
||||
|
|
@ -695,7 +695,7 @@ bool UILayer::updateFocusState(bool allowedFocus /* = false */) {
|
|||
void UILayer::handleInput(int iPad, int key, bool repeat, bool pressed,
|
||||
bool released, bool& handled) {
|
||||
// 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;
|
||||
if (scene->hasFocus(iPad) && scene->canHandleInput()) {
|
||||
// 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() {
|
||||
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;
|
||||
app.DebugPrintf("UILayer::HandleDLCMountingComplete - topScene\n");
|
||||
topScene->HandleDLCMountingComplete();
|
||||
|
|
@ -727,7 +727,7 @@ void UILayer::HandleDLCMountingComplete() {
|
|||
}
|
||||
|
||||
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;
|
||||
topScene->HandleDLCInstalled();
|
||||
}
|
||||
|
|
@ -735,7 +735,7 @@ void UILayer::HandleDLCInstalled() {
|
|||
|
||||
|
||||
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;
|
||||
topScene->HandleMessage(message, data);
|
||||
}
|
||||
|
|
@ -748,7 +748,7 @@ C4JRender::eViewportType UILayer::getViewport() {
|
|||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
|
@ -757,10 +757,10 @@ void UILayer::PrintTotalMemoryUsage(int64_t& totalStatic,
|
|||
int64_t& totalDynamic) {
|
||||
int64_t layerStatic = 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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
app.DebugPrintf(app.USER_SR, " \\- Layer static: %d , Layer dynamic: %d\n",
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ UIScene::~UIScene() {
|
|||
/* Destroy the Iggy player. */
|
||||
IggyPlayerDestroy(swf);
|
||||
|
||||
for (AUTO_VAR(it, m_registeredTextures.begin());
|
||||
for (auto it = m_registeredTextures.begin();
|
||||
it != m_registeredTextures.end(); ++it) {
|
||||
ui.unregisterSubstitutionTexture(it->first, it->second);
|
||||
}
|
||||
|
|
@ -90,7 +90,7 @@ void UIScene::reloadMovie(bool force) {
|
|||
handlePreReload();
|
||||
|
||||
// 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();
|
||||
}
|
||||
|
||||
|
|
@ -377,7 +377,7 @@ void UIScene::tick() {
|
|||
if (m_hasTickedOnce) m_bCanHandleInput = true;
|
||||
while (IggyPlayerReadyToTick(swf)) {
|
||||
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();
|
||||
}
|
||||
IggyPlayerTickRS(swf);
|
||||
|
|
@ -398,7 +398,7 @@ void UIScene::addTimer(int id, int ms) {
|
|||
}
|
||||
|
||||
void UIScene::killTimer(int id) {
|
||||
AUTO_VAR(it, m_timers.find(id));
|
||||
auto it = m_timers.find(id);
|
||||
if (it != m_timers.end()) {
|
||||
it->second.running = false;
|
||||
}
|
||||
|
|
@ -406,7 +406,7 @@ void UIScene::killTimer(int id) {
|
|||
|
||||
void UIScene::tickTimers() {
|
||||
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) {
|
||||
it = m_timers.erase(it);
|
||||
} else {
|
||||
|
|
@ -423,7 +423,7 @@ void UIScene::tickTimers() {
|
|||
|
||||
IggyName UIScene::registerFastName(const std::wstring& name) {
|
||||
IggyName var;
|
||||
AUTO_VAR(it, m_fastNames.find(name));
|
||||
auto it = m_fastNames.find(name);
|
||||
if (it != m_fastNames.end()) {
|
||||
var = it->second;
|
||||
} else {
|
||||
|
|
@ -551,7 +551,7 @@ void UIScene::customDrawSlotControl(IggyCustomDrawCallbackRegion* region,
|
|||
|
||||
PIXBeginNamedEvent(0, "Draw all cache");
|
||||
// Draw all the cached slots
|
||||
for (AUTO_VAR(it, m_cachedSlotDraw.begin());
|
||||
for (auto it = m_cachedSlotDraw.begin();
|
||||
it != m_cachedSlotDraw.end(); ++it) {
|
||||
CachedSlotDrawData* drawData = *it;
|
||||
ui.setupCustomDrawMatrices(this,
|
||||
|
|
@ -1094,7 +1094,7 @@ void UIScene::registerSubstitutionTexture(const std::wstring& textureName,
|
|||
|
||||
bool UIScene::hasRegisteredSubstitutionTexture(
|
||||
const std::wstring& textureName) {
|
||||
AUTO_VAR(it, m_registeredTextures.find(textureName));
|
||||
auto it = m_registeredTextures.find(textureName);
|
||||
|
||||
return it != m_registeredTextures.end();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ void UIScene_EndPoem::updateNoise() {
|
|||
|
||||
std::wstring tag = L"{*NOISE*}";
|
||||
|
||||
AUTO_VAR(it, m_noiseLengths.begin());
|
||||
auto it = m_noiseLengths.begin();
|
||||
int found = (int)noiseString.find(tag);
|
||||
while (found != std::string::npos && it != m_noiseLengths.end()) {
|
||||
length = *it;
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ void UIScene_InventoryMenu::updateEffectsDisplay() {
|
|||
int iValue = 0;
|
||||
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) {
|
||||
MobEffectInstance* effect = *it;
|
||||
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ UIScene_LoadOrJoinMenu::~UIScene_LoadOrJoinMenu() {
|
|||
app.SetLiveLinkRequired(false);
|
||||
|
||||
if (m_currentSessions) {
|
||||
for (AUTO_VAR(it, m_currentSessions->begin());
|
||||
for (auto it = m_currentSessions->begin();
|
||||
it < m_currentSessions->end(); ++it) {
|
||||
delete (*it);
|
||||
}
|
||||
|
|
@ -641,7 +641,7 @@ void UIScene_LoadOrJoinMenu::AddDefaultButtons() {
|
|||
|
||||
int i = 0;
|
||||
|
||||
for (AUTO_VAR(it, app.getLevelGenerators()->begin());
|
||||
for (auto it = app.getLevelGenerators()->begin();
|
||||
it != app.getLevelGenerators()->end(); ++it) {
|
||||
LevelGenerationOptions* levelGen = *it;
|
||||
|
||||
|
|
@ -1176,7 +1176,7 @@ void UIScene_LoadOrJoinMenu::UpdateGamesList() {
|
|||
unsigned int sessionIndex = 0;
|
||||
m_buttonListGames.setCurrentSelection(0);
|
||||
|
||||
for (AUTO_VAR(it, m_currentSessions->begin());
|
||||
for (auto it = m_currentSessions->begin();
|
||||
it < m_currentSessions->end(); ++it) {
|
||||
FriendSessionInfo* sessionInfo = *it;
|
||||
|
||||
|
|
|
|||
|
|
@ -1142,7 +1142,7 @@ SIZE_T WINAPI XMemSize(PVOID pAddress, DWORD dwAllocAttributes) {
|
|||
|
||||
void DumpMem() {
|
||||
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) {
|
||||
app.DebugPrintf("%d %d %d %d\n", (it->first >> 26) & 0x3f,
|
||||
it->first & 0x03ffffff, it->second,
|
||||
|
|
@ -1184,7 +1184,7 @@ void MemPixStuff() {
|
|||
|
||||
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) {
|
||||
int sect = (it->first >> 26) & 0x3f;
|
||||
int bytes = it->first & 0x03ffffff;
|
||||
|
|
|
|||
|
|
@ -1028,7 +1028,7 @@ SIZE_T WINAPI XMemSize(PVOID pAddress, DWORD dwAllocAttributes) {
|
|||
|
||||
void DumpMem() {
|
||||
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) {
|
||||
app.DebugPrintf("%d %d %d %d\n", (it->first >> 26) & 0x3f,
|
||||
it->first & 0x03ffffff, it->second,
|
||||
|
|
@ -1070,7 +1070,7 @@ void MemPixStuff() {
|
|||
|
||||
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) {
|
||||
int sect = (it->first >> 26) & 0x3f;
|
||||
int bytes = it->first & 0x03ffffff;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
// use - #pragma message(__LOC__"Need to do something here")
|
||||
|
||||
#define AUTO_VAR(_var, _val) auto _var = _val
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unordered_map>
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ void EntityTracker::addEntity(std::shared_ptr<Entity> e) {
|
|||
addEntity(e, 32 * 16, 2);
|
||||
std::shared_ptr<ServerPlayer> player =
|
||||
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) {
|
||||
(*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
|
||||
// player has actually been removed from the level's own player array
|
||||
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()) {
|
||||
std::shared_ptr<TrackedEntity> te = it->second;
|
||||
entityMap.erase(it);
|
||||
|
|
@ -128,7 +128,7 @@ void EntityTracker::removePlayer(std::shared_ptr<Entity> e) {
|
|||
if (e->GetType() == eTYPE_SERVERPLAYER) {
|
||||
std::shared_ptr<ServerPlayer> player =
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
@ -140,7 +140,7 @@ void EntityTracker::removePlayer(std::shared_ptr<Entity> e) {
|
|||
|
||||
void EntityTracker::tick() {
|
||||
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;
|
||||
te->tick(this, &level->players);
|
||||
if (te->moved && te->e->GetType() == eTYPE_SERVERPLAYER) {
|
||||
|
|
@ -182,7 +182,7 @@ void EntityTracker::tick() {
|
|||
for (unsigned int i = 0; i < movedPlayers.size(); i++) {
|
||||
std::shared_ptr<ServerPlayer> player = movedPlayers[i];
|
||||
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;
|
||||
if (te->e != 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
|
||||
for (AUTO_VAR(it, level->players.begin()); it != level->players.end();
|
||||
for (auto it = level->players.begin(); it != level->players.end();
|
||||
++it) {
|
||||
std::shared_ptr<ServerPlayer> player =
|
||||
std::dynamic_pointer_cast<ServerPlayer>(*it);
|
||||
|
|
@ -203,7 +203,7 @@ void EntityTracker::tick() {
|
|||
|
||||
void EntityTracker::broadcast(std::shared_ptr<Entity> e,
|
||||
std::shared_ptr<Packet> packet) {
|
||||
AUTO_VAR(it, entityMap.find(e->entityId));
|
||||
auto it = entityMap.find(e->entityId);
|
||||
if (it != entityMap.end()) {
|
||||
std::shared_ptr<TrackedEntity> te = it->second;
|
||||
te->broadcast(packet);
|
||||
|
|
@ -212,7 +212,7 @@ void EntityTracker::broadcast(std::shared_ptr<Entity> e,
|
|||
|
||||
void EntityTracker::broadcastAndSend(std::shared_ptr<Entity> e,
|
||||
std::shared_ptr<Packet> packet) {
|
||||
AUTO_VAR(it, entityMap.find(e->entityId));
|
||||
auto it = entityMap.find(e->entityId);
|
||||
if (it != entityMap.end()) {
|
||||
std::shared_ptr<TrackedEntity> te = it->second;
|
||||
te->broadcastAndSend(packet);
|
||||
|
|
@ -220,7 +220,7 @@ void EntityTracker::broadcastAndSend(std::shared_ptr<Entity> e,
|
|||
}
|
||||
|
||||
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;
|
||||
te->clear(serverPlayer);
|
||||
}
|
||||
|
|
@ -228,7 +228,7 @@ void EntityTracker::clear(std::shared_ptr<ServerPlayer> serverPlayer) {
|
|||
|
||||
void EntityTracker::playerLoadedChunk(std::shared_ptr<ServerPlayer> player,
|
||||
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;
|
||||
if (te->e != player && te->e->xChunk == chunk->x &&
|
||||
te->e->zChunk == chunk->z) {
|
||||
|
|
@ -244,7 +244,7 @@ void EntityTracker::updateMaxRange() {
|
|||
|
||||
std::shared_ptr<TrackedEntity> EntityTracker::getTracker(
|
||||
std::shared_ptr<Entity> e) {
|
||||
AUTO_VAR(it, entityMap.find(e->entityId));
|
||||
auto it = entityMap.find(e->entityId);
|
||||
if (it != entityMap.end()) {
|
||||
return it->second;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -153,8 +153,8 @@ void ServerPlayer::flagEntitiesToBeRemoved(unsigned int* flags,
|
|||
memset(flags, 0, 2048 / 32);
|
||||
}
|
||||
|
||||
AUTO_VAR(it, entitiesToRemove.begin());
|
||||
for (AUTO_VAR(it, entitiesToRemove.begin()); it != entitiesToRemove.end();
|
||||
auto it = entitiesToRemove.begin();
|
||||
for (auto it = entitiesToRemove.begin(); it != entitiesToRemove.end();
|
||||
it++) {
|
||||
int index = *it;
|
||||
if (index < 2048) {
|
||||
|
|
@ -259,7 +259,7 @@ void ServerPlayer::flushEntitiesToRemove() {
|
|||
intArray ids(amount);
|
||||
int pos = 0;
|
||||
|
||||
AUTO_VAR(it, entitiesToRemove.begin());
|
||||
auto it = entitiesToRemove.begin();
|
||||
while (it != entitiesToRemove.end() && pos < amount) {
|
||||
ids[pos++] = *it;
|
||||
it = entitiesToRemove.erase(it);
|
||||
|
|
@ -331,7 +331,7 @@ void ServerPlayer::doChunkSendingTick(bool dontDelayChunks) {
|
|||
// the spiral of chunks that that method creates, long before
|
||||
// transmission of them is complete.
|
||||
double dist = DBL_MAX;
|
||||
for (AUTO_VAR(it, chunksToSend.begin()); it != chunksToSend.end();
|
||||
for (auto it = chunksToSend.begin(); it != chunksToSend.end();
|
||||
it++) {
|
||||
ChunkPos chunk = *it;
|
||||
if (level->isChunkFinalised(chunk.x, chunk.z)) {
|
||||
|
|
@ -572,7 +572,7 @@ void ServerPlayer::doTickB() {
|
|||
players.push_back(
|
||||
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) {
|
||||
Objective* objective = *it;
|
||||
getScoreboard()
|
||||
|
|
@ -806,9 +806,9 @@ void ServerPlayer::changeDimension(int i) {
|
|||
thisPlayer->GetUserIndex());
|
||||
}
|
||||
if (thisPlayer != NULL) {
|
||||
for (AUTO_VAR(it, MinecraftServer::getInstance()
|
||||
for (auto it = MinecraftServer::getInstance()
|
||||
->getPlayers()
|
||||
->players.begin());
|
||||
->players.begin();
|
||||
it !=
|
||||
MinecraftServer::getInstance()->getPlayers()->players.end();
|
||||
++it) {
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ void TrackedEntity::tick(EntityTracker* tracker,
|
|||
!e->removed) {
|
||||
std::shared_ptr<MapItemSavedData> data =
|
||||
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::dynamic_pointer_cast<ServerPlayer>(*it);
|
||||
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
|
||||
// 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;
|
||||
bool dontSend = false;
|
||||
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
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
|
@ -441,13 +441,13 @@ void TrackedEntity::broadcastAndSend(std::shared_ptr<Packet> packet) {
|
|||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
void TrackedEntity::removePlayer(std::shared_ptr<ServerPlayer> sp) {
|
||||
AUTO_VAR(it, seenBy.find(sp));
|
||||
auto it = seenBy.find(sp);
|
||||
if (it != seenBy.end()) {
|
||||
sp->entitiesToRemove.push_back(e->entityId);
|
||||
seenBy.erase(it);
|
||||
|
|
@ -635,7 +635,7 @@ void TrackedEntity::updatePlayer(EntityTracker* tracker,
|
|||
std::dynamic_pointer_cast<LivingEntity>(e);
|
||||
std::vector<MobEffectInstance*>* activeEffects =
|
||||
mob->getActiveEffects();
|
||||
for (AUTO_VAR(it, activeEffects->begin());
|
||||
for (auto it = activeEffects->begin();
|
||||
it != activeEffects->end(); ++it) {
|
||||
MobEffectInstance* effect = *it;
|
||||
|
||||
|
|
@ -645,7 +645,7 @@ void TrackedEntity::updatePlayer(EntityTracker* tracker,
|
|||
delete activeEffects;
|
||||
}
|
||||
} else if (visibility == eVisibility_NotVisible) {
|
||||
AUTO_VAR(it, seenBy.find(sp));
|
||||
auto it = seenBy.find(sp);
|
||||
if (it != seenBy.end()) {
|
||||
seenBy.erase(it);
|
||||
sp->entitiesToRemove.push_back(e->entityId);
|
||||
|
|
@ -838,7 +838,7 @@ std::shared_ptr<Packet> TrackedEntity::getAddEntityPacket() {
|
|||
}
|
||||
|
||||
void TrackedEntity::clear(std::shared_ptr<ServerPlayer> sp) {
|
||||
AUTO_VAR(it, seenBy.find(sp));
|
||||
auto it = seenBy.find(sp);
|
||||
if (it != seenBy.end()) {
|
||||
seenBy.erase(it);
|
||||
sp->entitiesToRemove.push_back(e->entityId);
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ void Chunk::reconcileRenderableTileEntities(
|
|||
const std::vector<std::shared_ptr<TileEntity> >& renderableTileEntities) {
|
||||
int key =
|
||||
levelRenderer->getGlobalIndexForChunk(this->x, this->y, this->z, level);
|
||||
AUTO_VAR(it, globalRenderableTileEntities->find(key));
|
||||
auto it = globalRenderableTileEntities->find(key);
|
||||
if (!renderableTileEntities.empty()) {
|
||||
std::unordered_set<TileEntity*> currentRenderableTileEntitySet;
|
||||
currentRenderableTileEntitySet.reserve(renderableTileEntities.size());
|
||||
|
|
@ -45,7 +45,7 @@ void Chunk::reconcileRenderableTileEntities(
|
|||
LevelRenderer::RenderableTileEntityBucket& existingBucket =
|
||||
it->second;
|
||||
|
||||
for (AUTO_VAR(it2, existingBucket.tiles.begin());
|
||||
for (auto it2 = existingBucket.tiles.begin();
|
||||
it2 != existingBucket.tiles.end(); it2++) {
|
||||
TileEntity* tileEntity = (*it2).get();
|
||||
if (currentRenderableTileEntitySet.find(tileEntity) ==
|
||||
|
|
@ -78,7 +78,7 @@ void Chunk::reconcileRenderableTileEntities(
|
|||
}
|
||||
}
|
||||
} 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++) {
|
||||
(*it2)->setRenderRemoveStage(
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ EntityRenderDispatcher::EntityRenderDispatcher() {
|
|||
renderers[eTYPE_LIGHTNINGBOLT] = new LightningBoltRenderer();
|
||||
glDisable(GL_LIGHTING);
|
||||
|
||||
AUTO_VAR(itEnd, renderers.end());
|
||||
auto itEnd = renderers.end();
|
||||
for (classToRendererMap::iterator it = renderers.begin(); it != itEnd;
|
||||
it++) {
|
||||
it->second->init(this);
|
||||
|
|
@ -188,7 +188,7 @@ EntityRenderDispatcher::EntityRenderDispatcher() {
|
|||
EntityRenderer* EntityRenderDispatcher::getRenderer(eINSTANCEOF e) {
|
||||
if ((e & eTYPE_PLAYER) == eTYPE_PLAYER) e = eTYPE_PLAYER;
|
||||
// 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
|
||||
|
||||
if (it == renderers.end()) {
|
||||
|
|
@ -304,7 +304,7 @@ Font* EntityRenderDispatcher::getFont() { return font; }
|
|||
void EntityRenderDispatcher::registerTerrainTextures(
|
||||
IconRegister* iconRegister) {
|
||||
// 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;
|
||||
renderer->registerTerrainTextures(iconRegister);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ ResourceLocation* HorseRenderer::getOrCreateLayeredTextureLocation(
|
|||
std::shared_ptr<EntityHorse> horse) {
|
||||
std::wstring textureName = horse->getLayeredTextureHashName();
|
||||
|
||||
AUTO_VAR(it, LAYERED_LOCATION_CACHE.find(textureName));
|
||||
auto it = LAYERED_LOCATION_CACHE.find(textureName);
|
||||
|
||||
ResourceLocation* location;
|
||||
if (it != LAYERED_LOCATION_CACHE.end()) {
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ void PlayerRenderer::render(std::shared_ptr<Entity> _mob, double x, double y,
|
|||
mob->GetAdditionalModelParts();
|
||||
// turn them on
|
||||
if (pAdditionalModelParts != NULL) {
|
||||
for (AUTO_VAR(it, pAdditionalModelParts->begin());
|
||||
for (auto it = pAdditionalModelParts->begin();
|
||||
it != pAdditionalModelParts->end(); ++it) {
|
||||
ModelPart* pModelPart = *it;
|
||||
|
||||
|
|
@ -211,7 +211,7 @@ void PlayerRenderer::render(std::shared_ptr<Entity> _mob, double x, double y,
|
|||
|
||||
// turn them off again
|
||||
if (pAdditionalModelParts && pAdditionalModelParts->size() != 0) {
|
||||
for (AUTO_VAR(it, pAdditionalModelParts->begin());
|
||||
for (auto it = pAdditionalModelParts->begin();
|
||||
it != pAdditionalModelParts->end(); ++it) {
|
||||
ModelPart* pModelPart = *it;
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ TileEntityRenderDispatcher::TileEntityRenderDispatcher() {
|
|||
renderers[eTYPE_BEACONTILEENTITY] = new BeaconRenderer();
|
||||
glDisable(GL_LIGHTING);
|
||||
|
||||
AUTO_VAR(itEnd, renderers.end());
|
||||
auto itEnd = renderers.end();
|
||||
for (classToTileRendererMap::iterator it = renderers.begin(); it != itEnd;
|
||||
it++) {
|
||||
if (it->second) it->second->init(this);
|
||||
|
|
@ -58,7 +58,7 @@ TileEntityRenderDispatcher::TileEntityRenderDispatcher() {
|
|||
TileEntityRenderer* TileEntityRenderDispatcher::getRenderer(eINSTANCEOF e) {
|
||||
TileEntityRenderer* r = NULL;
|
||||
// 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
|
||||
|
||||
if (it == renderers.end()) {
|
||||
|
|
@ -143,7 +143,7 @@ void TileEntityRenderDispatcher::render(std::shared_ptr<TileEntity> entity,
|
|||
void TileEntityRenderDispatcher::setLevel(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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -310,8 +310,8 @@ void GameRenderer::pick(float a) {
|
|||
mc->level->getEntities(mc->cameraTargetPlayer, &grown);
|
||||
double nearest = dist;
|
||||
|
||||
AUTO_VAR(itEnd, objects->end());
|
||||
for (AUTO_VAR(it, objects->begin()); it != itEnd; it++) {
|
||||
auto itEnd = objects->end();
|
||||
for (auto it = objects->begin(); it != itEnd; it++) {
|
||||
std::shared_ptr<Entity> e = *it; // objects->at(i);
|
||||
if (!e->isPickable()) continue;
|
||||
|
||||
|
|
|
|||
|
|
@ -564,8 +564,8 @@ void LevelRenderer::renderEntities(Vec3* cam, Culler* culler, float a) {
|
|||
level[playerIndex]->getAllEntities();
|
||||
totalEntities = (int)entities.size();
|
||||
|
||||
AUTO_VAR(itEndGE, level[playerIndex]->globalEntities.end());
|
||||
for (AUTO_VAR(it, level[playerIndex]->globalEntities.begin());
|
||||
auto itEndGE = level[playerIndex]->globalEntities.end();
|
||||
for (auto it = level[playerIndex]->globalEntities.begin();
|
||||
it != itEndGE; it++) {
|
||||
std::shared_ptr<Entity> entity = *it; // level->globalEntities[i];
|
||||
renderedEntities++;
|
||||
|
|
@ -573,8 +573,8 @@ void LevelRenderer::renderEntities(Vec3* cam, Culler* culler, float a) {
|
|||
EntityRenderDispatcher::instance->render(entity, a);
|
||||
}
|
||||
|
||||
AUTO_VAR(itEndEnts, entities.end());
|
||||
for (AUTO_VAR(it, entities.begin()); it != itEndEnts; it++) {
|
||||
auto itEndEnts = entities.end();
|
||||
for (auto it = entities.begin(); it != itEndEnts; it++) {
|
||||
std::shared_ptr<Entity> entity = *it; // entities[i];
|
||||
|
||||
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
|
||||
// as the global flags.
|
||||
EnterCriticalSection(&m_csRenderableTileEntities);
|
||||
for (AUTO_VAR(it, renderableTileEntities.begin());
|
||||
for (auto it = renderableTileEntities.begin();
|
||||
it != renderableTileEntities.end(); it++) {
|
||||
int idx = it->first;
|
||||
// Don't render if it isn't in the same dimension as this player
|
||||
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++) {
|
||||
TileEntityRenderDispatcher::instance->render(*it2, a);
|
||||
}
|
||||
|
|
@ -854,7 +854,7 @@ void LevelRenderer::tick() {
|
|||
ticks++;
|
||||
|
||||
if ((ticks % SharedConstants::TICKS_PER_SECOND) == 0) {
|
||||
AUTO_VAR(it, destroyingBlocks.begin());
|
||||
auto it = destroyingBlocks.begin();
|
||||
while (it != destroyingBlocks.end()) {
|
||||
BlockDestructionProgress* block = it->second;
|
||||
|
||||
|
|
@ -2153,7 +2153,7 @@ void LevelRenderer::renderDestroyAnimation(Tesselator* t,
|
|||
t->offset((float)-xo, (float)-yo, (float)-zo);
|
||||
t->noColor();
|
||||
|
||||
AUTO_VAR(it, destroyingBlocks.begin());
|
||||
auto it = destroyingBlocks.begin();
|
||||
while (it != destroyingBlocks.end()) {
|
||||
BlockDestructionProgress* block = it->second;
|
||||
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,
|
||||
int progress) {
|
||||
if (progress < 0 || progress >= 10) {
|
||||
AUTO_VAR(it, destroyingBlocks.find(id));
|
||||
auto it = destroyingBlocks.find(id);
|
||||
if (it != destroyingBlocks.end()) {
|
||||
delete it->second;
|
||||
destroyingBlocks.erase(it);
|
||||
|
|
@ -3587,7 +3587,7 @@ void LevelRenderer::destroyTileProgress(int id, int x, int y, int z,
|
|||
} else {
|
||||
BlockDestructionProgress* entry = NULL;
|
||||
|
||||
AUTO_VAR(it, destroyingBlocks.find(id));
|
||||
auto it = destroyingBlocks.find(id);
|
||||
if (it != destroyingBlocks.end()) entry = it->second;
|
||||
|
||||
if (entry == NULL || entry->getX() != x || entry->getY() != y ||
|
||||
|
|
@ -3867,7 +3867,7 @@ void LevelRenderer::fullyFlagRenderableTileEntitiesToBeRemoved() {
|
|||
if (itChunk == renderableTileEntities.end()) continue;
|
||||
|
||||
RenderableTileEntityBucket& bucket = itChunk->second;
|
||||
for (AUTO_VAR(itPending, itKey->second.begin());
|
||||
for (auto itPending = itKey->second.begin();
|
||||
itPending != itKey->second.end(); itPending++) {
|
||||
if (bucket.indexByTile.find(*itPending) ==
|
||||
bucket.indexByTile.end()) {
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ void Minimap::render(std::shared_ptr<Player> player, Textures* textures,
|
|||
textures->bind(
|
||||
textures->loadTexture(TN_MISC_MAPICONS)); // L"/misc/mapicons.png"));
|
||||
|
||||
AUTO_VAR(itEnd, data->decorations.end());
|
||||
auto itEnd = data->decorations.end();
|
||||
|
||||
#if defined(_LARGE_WORLDS)
|
||||
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));
|
||||
|
||||
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;
|
||||
|
||||
char imgIndex = dec->img;
|
||||
|
|
|
|||
|
|
@ -55,10 +55,10 @@ void ModelPart::addChild(ModelPart* child) {
|
|||
}
|
||||
|
||||
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;
|
||||
|
||||
for (AUTO_VAR(itcube, child->cubes.begin());
|
||||
for (auto itcube = child->cubes.begin();
|
||||
itcube != child->cubes.end(); ++itcube) {
|
||||
Cube* pCube = *itcube;
|
||||
|
||||
|
|
|
|||
|
|
@ -261,8 +261,8 @@ void ParticleEngine::moveParticleInList(std::shared_ptr<Particle> particle,
|
|||
? 0
|
||||
: (particle->level->dimension->id == -1 ? 1 : 2);
|
||||
for (int tt = 0; tt < TEXTURE_COUNT; tt++) {
|
||||
AUTO_VAR(it, find(particles[l][tt][source].begin(),
|
||||
particles[l][tt][source].end(), particle));
|
||||
auto it = find(particles[l][tt][source].begin(),
|
||||
particles[l][tt][source].end(), particle);
|
||||
if (it != particles[l][tt][source].end()) {
|
||||
(*it) = particles[l][tt][source].back();
|
||||
particles[l][tt][source].pop_back();
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ TexturePackRepository::getTexturePackIdNames() {
|
|||
std::vector<std::pair<std::uint32_t, std::wstring> >* packList =
|
||||
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;
|
||||
packList->push_back(std::pair<std::uint32_t, std::wstring>(
|
||||
pack->getId(), pack->getName()));
|
||||
|
|
@ -142,7 +142,7 @@ bool TexturePackRepository::selectTexturePackById(std::uint32_t id) {
|
|||
// pack is installed
|
||||
app.SetRequiredTexturePackID(id);
|
||||
|
||||
AUTO_VAR(it, cacheById.find(id));
|
||||
auto it = cacheById.find(id);
|
||||
if (it != cacheById.end()) {
|
||||
TexturePack* newPack = it->second;
|
||||
if (newPack != selected) {
|
||||
|
|
@ -177,7 +177,7 @@ bool TexturePackRepository::selectTexturePackById(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()) {
|
||||
return it->second;
|
||||
}
|
||||
|
|
@ -213,19 +213,19 @@ TexturePack* TexturePackRepository::addTexturePackFromDLC(DLCPack* dlcPack,
|
|||
}
|
||||
|
||||
void TexturePackRepository::clearInvalidTexturePacks() {
|
||||
for (AUTO_VAR(it, m_texturePacksToDelete.begin());
|
||||
for (auto it = m_texturePacksToDelete.begin();
|
||||
it != m_texturePacksToDelete.end(); ++it) {
|
||||
delete *it;
|
||||
}
|
||||
}
|
||||
|
||||
void TexturePackRepository::removeTexturePackById(std::uint32_t id) {
|
||||
AUTO_VAR(it, cacheById.find(id));
|
||||
auto it = cacheById.find(id);
|
||||
if (it != cacheById.end()) {
|
||||
TexturePack* oldPack = it->second;
|
||||
|
||||
AUTO_VAR(it2,
|
||||
find(texturePacks->begin(), texturePacks->end(), oldPack));
|
||||
auto it2 =
|
||||
find(texturePacks->begin(), texturePacks->end(), oldPack);
|
||||
if (it2 != texturePacks->end()) {
|
||||
texturePacks->erase(it2);
|
||||
if (lastSelected == oldPack) {
|
||||
|
|
@ -264,7 +264,7 @@ TexturePack* TexturePackRepository::getTexturePackByIndex(unsigned int index) {
|
|||
|
||||
unsigned int TexturePackRepository::getTexturePackIndex(std::uint32_t id) {
|
||||
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;
|
||||
if (pack->getId() == id) break;
|
||||
++currentIndex;
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ PreStitchedTextureMap::PreStitchedTextureMap(int type, const std::wstring& name,
|
|||
void PreStitchedTextureMap::stitch() {
|
||||
// Animated StitchedTextures store a vector of textures for each frame of
|
||||
// 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) {
|
||||
StitchedTexture* animatedStitchedTexture = *it;
|
||||
animatedStitchedTexture->freeFrameTextures();
|
||||
|
|
@ -119,7 +119,7 @@ void PreStitchedTextureMap::stitch() {
|
|||
TextureManager::getInstance()->registerName(name, stitchResult);
|
||||
// stitchResult = stitcher->constructTexture(m_mipMap);
|
||||
|
||||
for (AUTO_VAR(it, texturesByName.begin()); it != texturesByName.end();
|
||||
for (auto it = texturesByName.begin(); it != texturesByName.end();
|
||||
++it) {
|
||||
StitchedTexture* preStitched = (StitchedTexture*)it->second;
|
||||
|
||||
|
|
@ -132,7 +132,7 @@ void PreStitchedTextureMap::stitch() {
|
|||
}
|
||||
|
||||
MemSect(52);
|
||||
for (AUTO_VAR(it, texturesByName.begin()); it != texturesByName.end();
|
||||
for (auto it = texturesByName.begin(); it != texturesByName.end();
|
||||
++it) {
|
||||
StitchedTexture* preStitched = (StitchedTexture*)(it->second);
|
||||
|
||||
|
|
@ -204,7 +204,7 @@ StitchedTexture* PreStitchedTextureMap::getTexture(const std::wstring& name) {
|
|||
|
||||
void PreStitchedTextureMap::cycleAnimationFrames() {
|
||||
// for (StitchedTexture texture : animatedTextures)
|
||||
for (AUTO_VAR(it, animatedTextures.begin()); it != animatedTextures.end();
|
||||
for (auto it = animatedTextures.begin(); it != animatedTextures.end();
|
||||
++it) {
|
||||
StitchedTexture* texture = *it;
|
||||
texture->cycleFrames();
|
||||
|
|
@ -225,7 +225,7 @@ Icon* PreStitchedTextureMap::registerIcon(const std::wstring& name) {
|
|||
// 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 (result == NULL) {
|
||||
|
|
@ -265,7 +265,7 @@ void PreStitchedTextureMap::loadUVs() {
|
|||
return;
|
||||
}
|
||||
|
||||
for (AUTO_VAR(it, texturesByName.begin()); it != texturesByName.end();
|
||||
for (auto it = texturesByName.begin(); it != texturesByName.end();
|
||||
++it) {
|
||||
delete it->second;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ bool StitchSlot::add(TextureHolder* textureHolder) {
|
|||
}
|
||||
|
||||
// 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;
|
||||
if (subSlot->add(textureHolder)) {
|
||||
return true;
|
||||
|
|
@ -124,7 +124,7 @@ void StitchSlot::collectAssignments(std::vector<StitchSlot*>* result) {
|
|||
result->push_back(this);
|
||||
} else if (subSlots != NULL) {
|
||||
// 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;
|
||||
subSlot->collectAssignments(result);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ StitchedTexture::StitchedTexture(const std::wstring& name,
|
|||
|
||||
void StitchedTexture::freeFrameTextures() {
|
||||
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);
|
||||
delete *it;
|
||||
}
|
||||
|
|
@ -54,7 +54,7 @@ void StitchedTexture::freeFrameTextures() {
|
|||
|
||||
StitchedTexture::~StitchedTexture() {
|
||||
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 frames;
|
||||
|
|
@ -218,7 +218,7 @@ void StitchedTexture::loadAnimationFrames(BufferedReader* bufferedReader) {
|
|||
if (line.length() > 0) {
|
||||
std::vector<std::wstring> tokens = stringSplit(line, L',');
|
||||
// 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;
|
||||
int multiPos = token.find_first_of('*');
|
||||
if (multiPos > 0) {
|
||||
|
|
@ -258,7 +258,7 @@ void StitchedTexture::loadAnimationFrames(const std::wstring& string) {
|
|||
|
||||
std::vector<std::wstring> tokens = stringSplit(trimString(string), L',');
|
||||
// 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);
|
||||
int multiPos = token.find_first_of('*');
|
||||
if (multiPos > 0) {
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ void Stitcher::stitch() {
|
|||
stitchedTexture = NULL;
|
||||
|
||||
// for (int i = 0; i < textureHolders.length; i++)
|
||||
for (AUTO_VAR(it, texturesToBeStitched.begin());
|
||||
for (auto it = texturesToBeStitched.begin();
|
||||
it != texturesToBeStitched.end(); ++it) {
|
||||
TextureHolder* textureHolder = *it; // textureHolders[i];
|
||||
|
||||
|
|
@ -91,7 +91,7 @@ std::vector<StitchSlot*>* Stitcher::gatherAreas() {
|
|||
std::vector<StitchSlot*>* result = new std::vector<StitchSlot*>();
|
||||
|
||||
// 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;
|
||||
slot->collectAssignments(result);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ void TextureMap::stitch() {
|
|||
|
||||
Stitcher* stitcher = TextureManager::getInstance()->createStitcher(name);
|
||||
|
||||
for (AUTO_VAR(it, texturesByName.begin()); it != texturesByName.end();
|
||||
for (auto it = texturesByName.begin(); it != texturesByName.end();
|
||||
++it) {
|
||||
delete it->second;
|
||||
}
|
||||
|
|
@ -83,7 +83,7 @@ void TextureMap::stitch() {
|
|||
|
||||
// Extract frames from textures and add them to the stitchers
|
||||
// for (final String name : texturesToRegister.keySet())
|
||||
for (AUTO_VAR(it, texturesToRegister.begin());
|
||||
for (auto it = texturesToRegister.begin();
|
||||
it != texturesToRegister.end(); ++it) {
|
||||
std::wstring name = it->first;
|
||||
|
||||
|
|
@ -120,9 +120,9 @@ void TextureMap::stitch() {
|
|||
stitchResult = stitcher->constructTexture(m_mipMap);
|
||||
|
||||
// Extract all the final positions and store them
|
||||
AUTO_VAR(areas, stitcher->gatherAreas());
|
||||
auto areas = 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;
|
||||
TextureHolder* textureHolder = slot->getHolder();
|
||||
|
||||
|
|
@ -133,7 +133,7 @@ void TextureMap::stitch() {
|
|||
|
||||
StitchedTexture* stored = NULL;
|
||||
|
||||
AUTO_VAR(itTex, texturesToRegister.find(textureName));
|
||||
auto itTex = texturesToRegister.find(textureName);
|
||||
if (itTex != texturesToRegister.end()) stored = itTex->second;
|
||||
|
||||
// [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;
|
||||
|
||||
// for (StitchedTexture texture : texturesToRegister.values())
|
||||
for (AUTO_VAR(it, texturesToRegister.begin());
|
||||
for (auto it = texturesToRegister.begin();
|
||||
it != texturesToRegister.end(); ++it) {
|
||||
StitchedTexture* texture = it->second;
|
||||
texture->replaceWith(missingPosition);
|
||||
|
|
@ -212,7 +212,7 @@ StitchedTexture* TextureMap::getTexture(const std::wstring& name) {
|
|||
|
||||
void TextureMap::cycleAnimationFrames() {
|
||||
// for (StitchedTexture texture : animatedTextures)
|
||||
for (AUTO_VAR(it, animatedTextures.begin()); it != animatedTextures.end();
|
||||
for (auto it = animatedTextures.begin(); it != animatedTextures.end();
|
||||
++it) {
|
||||
StitchedTexture* texture = *it;
|
||||
texture->cycleFrames();
|
||||
|
|
@ -233,7 +233,7 @@ Icon* TextureMap::registerIcon(const std::wstring& name) {
|
|||
|
||||
// TODO: [EB]: Why do we allow multiple registrations?
|
||||
StitchedTexture* result = NULL;
|
||||
AUTO_VAR(it, texturesToRegister.find(name));
|
||||
auto it = texturesToRegister.find(name);
|
||||
if (it != texturesToRegister.end()) result = it->second;
|
||||
|
||||
if (result == NULL) {
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ void TextureManager::registerName(const std::wstring& name, 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) {
|
||||
if (it->second == texture) {
|
||||
// Minecraft.getInstance().getLogger().warning("TextureManager.registerTexture
|
||||
|
|
@ -55,10 +55,10 @@ void TextureManager::registerTexture(Texture* texture) {
|
|||
|
||||
void TextureManager::unregisterTexture(const std::wstring& name,
|
||||
Texture* texture) {
|
||||
AUTO_VAR(it, idToTextureMap.find(texture->getManagerId()));
|
||||
auto it = idToTextureMap.find(texture->getManagerId());
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -993,7 +993,7 @@ void Textures::removeHttpTexture(const std::wstring& url) {
|
|||
int Textures::loadMemTexture(const std::wstring& url,
|
||||
const std::wstring& backup) {
|
||||
MemTexture* texture = NULL;
|
||||
AUTO_VAR(it, memTextures.find(url));
|
||||
auto it = memTextures.find(url);
|
||||
if (it != memTextures.end()) {
|
||||
texture = (*it).second;
|
||||
}
|
||||
|
|
@ -1030,7 +1030,7 @@ int Textures::loadMemTexture(const std::wstring& url,
|
|||
|
||||
int Textures::loadMemTexture(const std::wstring& url, int backup) {
|
||||
MemTexture* texture = NULL;
|
||||
AUTO_VAR(it, memTextures.find(url));
|
||||
auto it = memTextures.find(url);
|
||||
if (it != memTextures.end()) {
|
||||
texture = (*it).second;
|
||||
}
|
||||
|
|
@ -1067,7 +1067,7 @@ int Textures::loadMemTexture(const std::wstring& url, int backup) {
|
|||
MemTexture* Textures::addMemTexture(const std::wstring& name,
|
||||
MemTextureProcessor* processor) {
|
||||
MemTexture* texture = NULL;
|
||||
AUTO_VAR(it, memTextures.find(name));
|
||||
auto it = memTextures.find(name);
|
||||
if (it != memTextures.end()) {
|
||||
texture = (*it).second;
|
||||
}
|
||||
|
|
@ -1107,7 +1107,7 @@ MemTexture* Textures::addMemTexture(const std::wstring& name,
|
|||
|
||||
void Textures::removeMemTexture(const std::wstring& url) {
|
||||
MemTexture* texture = NULL;
|
||||
AUTO_VAR(it, memTextures.find(url));
|
||||
auto it = memTextures.find(url);
|
||||
if (it != memTextures.end()) {
|
||||
texture = (*it).second;
|
||||
|
||||
|
|
@ -1153,7 +1153,7 @@ void Textures::tick(
|
|||
// 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
|
||||
// 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;
|
||||
|
||||
if (tex &&
|
||||
|
|
|
|||
|
|
@ -321,8 +321,8 @@ void Font::drawWordWrapInternal(const std::wstring& string, int x, int y, int w,
|
|||
int col, bool darken, int h) {
|
||||
std::vector<std::wstring> lines = stringSplit(string, L'\n');
|
||||
if (lines.size() > 1) {
|
||||
AUTO_VAR(itEnd, lines.end());
|
||||
for (AUTO_VAR(it, lines.begin()); it != itEnd; it++) {
|
||||
auto itEnd = lines.end();
|
||||
for (auto it = lines.begin(); it != itEnd; it++) {
|
||||
// 4J Stu - Don't draw text that will be partially cutoff/overlap
|
||||
// something it shouldn't
|
||||
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');
|
||||
if (lines.size() > 1) {
|
||||
int h = 0;
|
||||
AUTO_VAR(itEnd, lines.end());
|
||||
for (AUTO_VAR(it, lines.begin()); it != itEnd; it++) {
|
||||
auto itEnd = lines.end();
|
||||
for (auto it = lines.begin(); it != itEnd; it++) {
|
||||
h += this->wordWrapHeight(*it, w);
|
||||
}
|
||||
return h;
|
||||
|
|
|
|||
|
|
@ -1331,8 +1331,8 @@ void Gui::tick() {
|
|||
// viewing the Pause Menu. We don't show the guiMessages when a menu is
|
||||
// up, so don't fade them out
|
||||
if (!ui.GetMenuDisplayed(iPad)) {
|
||||
AUTO_VAR(itEnd, guiMessages[iPad].end());
|
||||
for (AUTO_VAR(it, guiMessages[iPad].begin()); it != itEnd; it++) {
|
||||
auto itEnd = guiMessages[iPad].end();
|
||||
for (auto it = guiMessages[iPad].begin(); it != itEnd; it++) {
|
||||
(*it).ticks++;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ Screen::Screen() // 4J added
|
|||
}
|
||||
|
||||
void Screen::render(int xm, int ym, float a) {
|
||||
AUTO_VAR(itEnd, buttons.end());
|
||||
for (AUTO_VAR(it, buttons.begin()); it != itEnd; it++) {
|
||||
auto itEnd = buttons.end();
|
||||
for (auto it = buttons.begin(); it != itEnd; it++) {
|
||||
Button* button = *it; // buttons[i];
|
||||
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) {
|
||||
if (buttonNum == 0) {
|
||||
AUTO_VAR(itEnd, buttons.end());
|
||||
for (AUTO_VAR(it, buttons.begin()); it != itEnd; it++) {
|
||||
auto itEnd = buttons.end();
|
||||
for (auto it = buttons.begin(); it != itEnd; it++) {
|
||||
Button* button = *it; // buttons[i];
|
||||
if (button->clicked(minecraft, x, y)) {
|
||||
clickedButton = button;
|
||||
|
|
|
|||
|
|
@ -49,8 +49,8 @@ void AbstractContainerScreen::render(int xm, int ym, float a) {
|
|||
|
||||
Slot* hoveredSlot = NULL;
|
||||
|
||||
AUTO_VAR(itEnd, menu->slots.end());
|
||||
for (AUTO_VAR(it, menu->slots.begin()); it != itEnd; it++) {
|
||||
auto itEnd = menu->slots.end();
|
||||
for (auto it = menu->slots.begin(); it != itEnd; it++) {
|
||||
Slot* slot = *it; // menu->slots.at(i);
|
||||
|
||||
renderSlot(slot);
|
||||
|
|
@ -300,8 +300,8 @@ void AbstractContainerScreen::renderSlot(Slot* slot) {
|
|||
}
|
||||
|
||||
Slot* AbstractContainerScreen::findSlot(int x, int y) {
|
||||
AUTO_VAR(itEnd, menu->slots.end());
|
||||
for (AUTO_VAR(it, menu->slots.begin()); it != itEnd; it++) {
|
||||
auto itEnd = menu->slots.end();
|
||||
for (auto it = menu->slots.begin(); it != itEnd; it++) {
|
||||
Slot* slot = *it; // menu->slots.at(i);
|
||||
if (isHovering(slot, x, y)) return slot;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ ArchiveFile::~ArchiveFile() { delete m_cachedData; }
|
|||
std::vector<std::wstring>* ArchiveFile::getFileList() {
|
||||
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);
|
||||
|
||||
|
|
@ -88,7 +88,7 @@ int ArchiveFile::getFileSize(const std::wstring& filename) {
|
|||
|
||||
byteArray ArchiveFile::getFile(const std::wstring& filename) {
|
||||
byteArray out;
|
||||
AUTO_VAR(it, m_index.find(filename));
|
||||
auto it = m_index.find(filename);
|
||||
|
||||
if (it == m_index.end()) {
|
||||
app.DebugPrintf("Couldn't find file in archive\n");
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ int MemoryTracker::genTextures() {
|
|||
}
|
||||
|
||||
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()) {
|
||||
glDeleteLists(id, it->second);
|
||||
GL_LIST_IDS.erase(it);
|
||||
|
|
@ -36,7 +36,7 @@ void MemoryTracker::releaseTextures() {
|
|||
|
||||
void MemoryTracker::release() {
|
||||
// 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);
|
||||
}
|
||||
GL_LIST_IDS.clear();
|
||||
|
|
|
|||
|
|
@ -43,11 +43,11 @@ void StringTable::ProcessStringTableData(void) {
|
|||
int dataSize = 0;
|
||||
|
||||
//
|
||||
for (AUTO_VAR(it_locales, locales.begin());
|
||||
for (auto it_locales = locales.begin();
|
||||
it_locales != locales.end() && (!foundLang); it_locales++) {
|
||||
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) {
|
||||
app.DebugPrintf("StringTable:: Found language '%ls'.\n",
|
||||
it_locales->c_str());
|
||||
|
|
@ -135,7 +135,7 @@ const wchar_t* StringTable::getString(const std::wstring& id) {
|
|||
}
|
||||
#endif
|
||||
|
||||
AUTO_VAR(it, m_stringsMap.find(id));
|
||||
auto it = m_stringsMap.find(id);
|
||||
|
||||
if (it != m_stringsMap.end()) {
|
||||
return it->second.c_str();
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
#include "BaseAttributeMap.h"
|
||||
|
||||
BaseAttributeMap::~BaseAttributeMap() {
|
||||
for (AUTO_VAR(it, attributesById.begin()); it != attributesById.end();
|
||||
for (auto it = attributesById.begin(); it != attributesById.end();
|
||||
++it) {
|
||||
delete it->second;
|
||||
}
|
||||
|
|
@ -14,7 +14,7 @@ AttributeInstance* BaseAttributeMap::getInstance(Attribute* attribute) {
|
|||
}
|
||||
|
||||
AttributeInstance* BaseAttributeMap::getInstance(eATTRIBUTE_ID id) {
|
||||
AUTO_VAR(it, attributesById.find(id));
|
||||
auto it = attributesById.find(id);
|
||||
if (it != attributesById.end()) {
|
||||
return it->second;
|
||||
} else {
|
||||
|
|
@ -23,7 +23,7 @@ AttributeInstance* BaseAttributeMap::getInstance(eATTRIBUTE_ID id) {
|
|||
}
|
||||
|
||||
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) {
|
||||
atts.push_back(it->second);
|
||||
}
|
||||
|
|
@ -35,7 +35,7 @@ void BaseAttributeMap::onAttributeModified(
|
|||
void BaseAttributeMap::removeItemModifiers(std::shared_ptr<ItemInstance> item) {
|
||||
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);
|
||||
AttributeModifier* modifier = it->second;
|
||||
|
||||
|
|
@ -52,7 +52,7 @@ void BaseAttributeMap::removeItemModifiers(std::shared_ptr<ItemInstance> item) {
|
|||
void BaseAttributeMap::addItemModifiers(std::shared_ptr<ItemInstance> item) {
|
||||
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);
|
||||
AttributeModifier* modifier = it->second;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ ModifiableAttributeInstance::ModifiableAttributeInstance(
|
|||
|
||||
ModifiableAttributeInstance::~ModifiableAttributeInstance() {
|
||||
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) {
|
||||
// Delete all modifiers
|
||||
delete *it;
|
||||
|
|
@ -45,7 +45,7 @@ void ModifiableAttributeInstance::getModifiers(
|
|||
for (int i = 0; i < AttributeModifier::TOTAL_OPERATIONS; 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) {
|
||||
result.insert(*it);
|
||||
}
|
||||
|
|
@ -55,7 +55,7 @@ void ModifiableAttributeInstance::getModifiers(
|
|||
AttributeModifier* ModifiableAttributeInstance::getModifier(eMODIFIER_ID id) {
|
||||
AttributeModifier* modifier = NULL;
|
||||
|
||||
AUTO_VAR(it, modifierById.find(id));
|
||||
auto it = modifierById.find(id);
|
||||
if (it != modifierById.end()) {
|
||||
modifier = it->second;
|
||||
}
|
||||
|
|
@ -65,7 +65,7 @@ AttributeModifier* ModifiableAttributeInstance::getModifier(eMODIFIER_ID id) {
|
|||
|
||||
void ModifiableAttributeInstance::addModifiers(
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
@ -94,7 +94,7 @@ void ModifiableAttributeInstance::setDirty() {
|
|||
|
||||
void ModifiableAttributeInstance::removeModifier(AttributeModifier* modifier) {
|
||||
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) {
|
||||
if (modifier->equals(*it)) {
|
||||
modifiers[i].erase(it);
|
||||
|
|
@ -117,7 +117,7 @@ void ModifiableAttributeInstance::removeModifiers() {
|
|||
std::unordered_set<AttributeModifier*> removingModifiers;
|
||||
getModifiers(removingModifiers);
|
||||
|
||||
for (AUTO_VAR(it, removingModifiers.begin()); it != removingModifiers.end();
|
||||
for (auto it = removingModifiers.begin(); it != removingModifiers.end();
|
||||
++it) {
|
||||
removeModifier(*it);
|
||||
}
|
||||
|
|
@ -137,7 +137,7 @@ double ModifiableAttributeInstance::calculateValue() {
|
|||
std::unordered_set<AttributeModifier*>* modifiers;
|
||||
|
||||
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;
|
||||
base += modifier->getAmount();
|
||||
}
|
||||
|
|
@ -145,13 +145,13 @@ double ModifiableAttributeInstance::calculateValue() {
|
|||
double result = 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;
|
||||
result += base * modifier->getAmount();
|
||||
}
|
||||
|
||||
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;
|
||||
result *= 1 + modifier->getAmount();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ AttributeInstance* ServersideAttributeMap::getInstance(eATTRIBUTE_ID id) {
|
|||
// If we didn't find it, search by legacy name
|
||||
/*if (result == NULL)
|
||||
{
|
||||
AUTO_VAR(it, attributesByLegacy.find(name));
|
||||
auto it = attributesByLegacy.find(name);
|
||||
if(it != attributesByLegacy.end())
|
||||
{
|
||||
result = it->second;
|
||||
|
|
@ -29,7 +29,7 @@ AttributeInstance* ServersideAttributeMap::getInstance(eATTRIBUTE_ID id) {
|
|||
|
||||
AttributeInstance* ServersideAttributeMap::registerAttribute(
|
||||
Attribute* attribute) {
|
||||
AUTO_VAR(it, attributesById.find(attribute->getId()));
|
||||
auto it = attributesById.find(attribute->getId());
|
||||
if (it != attributesById.end()) {
|
||||
return it->second;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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(unseen.begin(), unseen.end(), target) != unseen.end()) return
|
||||
// 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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ std::shared_ptr<Animal> BreedGoal::getFreePartner() {
|
|||
level->getEntitiesOfClass(typeid(*animal), &grown_bb);
|
||||
double dist = std::numeric_limits<double>::max();
|
||||
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);
|
||||
if (animal->canMate(p) && animal->distanceToSqr(p) < dist) {
|
||||
partner = p;
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ bool FollowParentGoal::canUse() {
|
|||
|
||||
std::shared_ptr<Animal> closest = nullptr;
|
||||
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);
|
||||
if (parent->getAge() < 0) continue;
|
||||
double distSqr = animal->distanceToSqr(parent);
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ 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;
|
||||
delete (*it);
|
||||
}
|
||||
|
|
@ -29,12 +29,12 @@ void GoalSelector::addGoal(
|
|||
}
|
||||
|
||||
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;
|
||||
Goal* goal = ig->goal;
|
||||
|
||||
if (goal == toRemove) {
|
||||
AUTO_VAR(it2, find(usingGoals.begin(), usingGoals.end(), ig));
|
||||
auto it2 = find(usingGoals.begin(), usingGoals.end(), ig);
|
||||
if (it2 != usingGoals.end()) {
|
||||
goal->stop();
|
||||
usingGoals.erase(it2);
|
||||
|
|
@ -54,10 +54,10 @@ void GoalSelector::tick() {
|
|||
|
||||
if (tickCount++ % newGoalRate == 0) {
|
||||
// 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;
|
||||
// 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 (usingIt != usingGoals.end()) {
|
||||
|
|
@ -75,7 +75,7 @@ void GoalSelector::tick() {
|
|||
usingGoals.push_back(ig);
|
||||
}
|
||||
} else {
|
||||
for (AUTO_VAR(it, usingGoals.begin()); it != usingGoals.end();) {
|
||||
for (auto it = usingGoals.begin(); it != usingGoals.end();) {
|
||||
InternalGoal* ig = *it;
|
||||
if (!ig->goal->canContinueToUse()) {
|
||||
ig->goal->stop();
|
||||
|
|
@ -89,14 +89,14 @@ void GoalSelector::tick() {
|
|||
// bool debug = false;
|
||||
// if (debug && toStart.size() > 0) System.out.println("Starting: ");
|
||||
// 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() + ", ");
|
||||
(*it)->goal->start();
|
||||
}
|
||||
|
||||
// if (debug && usingGoals.size() > 0) System.out.println("Running: ");
|
||||
// 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());
|
||||
(*it)->goal->tick();
|
||||
}
|
||||
|
|
@ -112,11 +112,11 @@ bool GoalSelector::canContinueToUse(InternalGoal* ig) {
|
|||
|
||||
bool GoalSelector::canUseInSystem(GoalSelector::InternalGoal* goal) {
|
||||
// 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;
|
||||
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 (usingIt != usingGoals.end() && !canCoExist(goal, ig))
|
||||
|
|
@ -139,7 +139,7 @@ void GoalSelector::setNewGoalRate(int newGoalRate) {
|
|||
}
|
||||
|
||||
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;
|
||||
ig->goal->setLevel(level);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ void HurtByTargetGoal::start() {
|
|||
std::vector<std::shared_ptr<Entity> >* nearby =
|
||||
mob->level->getEntitiesOfClass(
|
||||
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::dynamic_pointer_cast<PathfinderMob>(*it);
|
||||
if (this->mob->shared_from_this() == other) continue;
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ std::shared_ptr<DoorInfo> MoveThroughVillageGoal::getNextDoorInfo(
|
|||
std::vector<std::shared_ptr<DoorInfo> >* doorInfos =
|
||||
village->getDoorInfos();
|
||||
// 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;
|
||||
int distSqr = di->distanceToSqr(Mth::floor(mob->x), Mth::floor(mob->y),
|
||||
Mth::floor(mob->z));
|
||||
|
|
@ -106,7 +106,7 @@ std::shared_ptr<DoorInfo> MoveThroughVillageGoal::getNextDoorInfo(
|
|||
|
||||
bool MoveThroughVillageGoal::hasVisited(std::shared_ptr<DoorInfo> di) {
|
||||
// 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();
|
||||
if (di2 == NULL) {
|
||||
it = visited.erase(it);
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ bool PlayGoal::canUse() {
|
|||
mob->level->getEntitiesOfClass(typeid(Villager), &mob_bb);
|
||||
double closestDistSqr = std::numeric_limits<double>::max();
|
||||
// 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;
|
||||
if (c.get() == mob) continue;
|
||||
std::shared_ptr<Villager> friendV =
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ bool TakeFlowerGoal::canUse() {
|
|||
}
|
||||
|
||||
// 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::dynamic_pointer_cast<VillagerGolem>(*it);
|
||||
if (vg->getOfferFlowerTick() > 0) {
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ PathFinder::~PathFinder() {
|
|||
// so just need to destroy their containers
|
||||
delete[] neighbors->data;
|
||||
delete neighbors;
|
||||
AUTO_VAR(itEnd, nodes.end());
|
||||
for (AUTO_VAR(it, nodes.begin()); it != itEnd; it++) {
|
||||
auto itEnd = nodes.end();
|
||||
for (auto it = nodes.begin(); it != itEnd; it++) {
|
||||
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) {
|
||||
int i = Node::createHash(x, y, z);
|
||||
Node* node;
|
||||
AUTO_VAR(it, nodes.find(i));
|
||||
auto it = nodes.find(i);
|
||||
if (it == nodes.end()) {
|
||||
MemSect(54);
|
||||
node = new Node(x, y, z);
|
||||
|
|
|
|||
|
|
@ -117,8 +117,8 @@ BaseRailTile::Rail* BaseRailTile::Rail::getRail(TilePos* p) {
|
|||
|
||||
bool BaseRailTile::Rail::connectsTo(Rail* rail) {
|
||||
if (m_bValidRail) {
|
||||
AUTO_VAR(itEnd, connections.end());
|
||||
for (AUTO_VAR(it, connections.begin()); it != itEnd; it++) {
|
||||
auto itEnd = connections.end();
|
||||
for (auto it = connections.begin(); it != itEnd; it++) {
|
||||
TilePos* p = *it; // connections[i];
|
||||
if (p->x == rail->x && p->z == rail->z) {
|
||||
return true;
|
||||
|
|
@ -130,8 +130,8 @@ bool BaseRailTile::Rail::connectsTo(Rail* rail) {
|
|||
|
||||
bool BaseRailTile::Rail::hasConnection(int x, int y, int z) {
|
||||
if (m_bValidRail) {
|
||||
AUTO_VAR(itEnd, connections.end());
|
||||
for (AUTO_VAR(it, connections.begin()); it != itEnd; it++) {
|
||||
auto itEnd = connections.end();
|
||||
for (auto it = connections.begin(); it != itEnd; it++) {
|
||||
TilePos* p = *it; // connections[i];
|
||||
if (p->x == x && p->z == z) {
|
||||
return true;
|
||||
|
|
@ -278,8 +278,8 @@ void BaseRailTile::Rail::place(bool hasSignal, bool first) {
|
|||
if (first || level->getData(x, y, z) != data) {
|
||||
level->setData(x, y, z, data, Tile::UPDATE_ALL);
|
||||
|
||||
AUTO_VAR(itEnd, connections.end());
|
||||
for (AUTO_VAR(it, connections.begin()); it != itEnd; it++) {
|
||||
auto itEnd = connections.end();
|
||||
for (auto it = connections.begin(); it != itEnd; it++) {
|
||||
Rail* neighbor = getRail(*it);
|
||||
if (neighbor == NULL) continue;
|
||||
neighbor->removeSoftConnections();
|
||||
|
|
|
|||
|
|
@ -97,8 +97,8 @@ bool BedTile::use(Level* level, int x, int y, int z,
|
|||
|
||||
if (isOccupied(data)) {
|
||||
std::shared_ptr<Player> sleepingPlayer = nullptr;
|
||||
AUTO_VAR(itEnd, level->players.end());
|
||||
for (AUTO_VAR(it, level->players.begin()); it != itEnd; it++) {
|
||||
auto itEnd = level->players.end();
|
||||
for (auto it = level->players.begin(); it != itEnd; it++) {
|
||||
std::shared_ptr<Player> p = *it;
|
||||
if (p->isSleeping()) {
|
||||
Pos pos = p->bedPosition;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
std::vector<std::shared_ptr<Entity> >* entities =
|
||||
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);
|
||||
if (ocelot->isSitting()) {
|
||||
delete entities;
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ void FallingTile::tick() {
|
|||
CompoundTag* swap = new CompoundTag();
|
||||
tileEntity->save(swap);
|
||||
std::vector<Tag*>* allTags = tileData->getAllTags();
|
||||
for (AUTO_VAR(it, allTags->begin());
|
||||
for (auto it = allTags->begin();
|
||||
it != allTags->end(); ++it) {
|
||||
Tag* tag = *it;
|
||||
if (tag->getName().compare(L"x") == 0 ||
|
||||
|
|
@ -173,7 +173,7 @@ void FallingTile::causeFallDamage(float distance) {
|
|||
? DamageSource::anvil
|
||||
: DamageSource::fallingBlock;
|
||||
// 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),
|
||||
fallDamageMax));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -133,8 +133,8 @@ const int MobSpawner::tick(ServerLevel* level, bool spawnEnemies,
|
|||
continue;
|
||||
}
|
||||
|
||||
AUTO_VAR(itEndCTP, chunksToPoll.end());
|
||||
for (AUTO_VAR(it, chunksToPoll.begin()); it != itEndCTP; it++) {
|
||||
auto itEndCTP = chunksToPoll.end();
|
||||
for (auto it = chunksToPoll.begin(); it != itEndCTP; it++) {
|
||||
if (it->second) {
|
||||
// don't add mobs to edge chunks, to prevent adding mobs
|
||||
// "outside" of the active playground
|
||||
|
|
|
|||
|
|
@ -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()));
|
||||
int count = 0;
|
||||
|
||||
AUTO_VAR(itEnd, recentToggles[level]->end());
|
||||
for (AUTO_VAR(it, recentToggles[level]->begin()); it != itEnd; it++) {
|
||||
auto itEnd = recentToggles[level]->end();
|
||||
for (auto it = recentToggles[level]->begin(); it != itEnd; it++) {
|
||||
if (it->x == x && it->y == y && it->z == z) {
|
||||
count++;
|
||||
if (count >= MAX_RECENT_TOGGLES) {
|
||||
|
|
@ -207,7 +207,7 @@ void NotGateTile::levelTimeChanged(Level* level, int64_t delta,
|
|||
std::deque<Toggle>* toggles = recentToggles[level];
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ int PressurePlateTile::getSignalStrength(Level* level, int x, int y, int z) {
|
|||
// location.
|
||||
|
||||
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;
|
||||
if (!e->isIgnoringTileTriggers()) {
|
||||
if (sensitivity != everything) delete entities;
|
||||
|
|
|
|||
|
|
@ -78,8 +78,8 @@ void RedStoneDustTile::updatePowerStrength(Level* level, int x, int y, int z) {
|
|||
std::vector<TilePos>(toUpdate.begin(), toUpdate.end());
|
||||
toUpdate.clear();
|
||||
|
||||
AUTO_VAR(itEnd, updates.end());
|
||||
for (AUTO_VAR(it, updates.begin()); it != itEnd; it++) {
|
||||
auto itEnd = updates.end();
|
||||
for (auto it = updates.begin(); it != itEnd; it++) {
|
||||
TilePos tp = *it;
|
||||
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
Loading…
Reference in a new issue