@@ -82,8 +82,8 @@ void CGameSpawnConstructor::load_spawns(LPCSTR name, bool no_separator_check)
8282
8383 // load levels
8484 GameGraph::SLevel level;
85- LEVEL_INFO_STORAGE::const_iterator I = m_levels.begin ();
86- LEVEL_INFO_STORAGE::const_iterator E = m_levels.end ();
85+ auto I = m_levels.begin ();
86+ auto E = m_levels.end ();
8787 for (; I != E; ++I)
8888 {
8989 level.m_offset = (*I).m_offset ;
@@ -103,8 +103,8 @@ void CGameSpawnConstructor::load_spawns(LPCSTR name, bool no_separator_check)
103103
104104void CGameSpawnConstructor::process_spawns ()
105105{
106- LEVEL_SPAWN_STORAGE::iterator I = m_level_spawns.begin ();
107- LEVEL_SPAWN_STORAGE::iterator E = m_level_spawns.end ();
106+ auto I = m_level_spawns.begin ();
107+ auto E = m_level_spawns.end ();
108108 for (; I != E; ++I)
109109#ifdef NO_MULTITHREADING
110110 (*I)->Execute ();
@@ -123,14 +123,14 @@ void CGameSpawnConstructor::process_spawns()
123123
124124void CGameSpawnConstructor::verify_spawns (ALife::_SPAWN_ID spawn_id)
125125{
126- xr_vector<ALife::_SPAWN_ID>::iterator J = std::find (m_temp0.begin (), m_temp0.end (), spawn_id);
126+ auto J = std::find (m_temp0.begin (), m_temp0.end (), spawn_id);
127127 R_ASSERT3 (J == m_temp0.end (), " RECURSIVE Spawn group chain found in spawn" ,
128128 m_spawn_graph->vertex (spawn_id)->data ()->object ().name_replace ());
129129 m_temp0.push_back (spawn_id);
130130
131- SPAWN_GRAPH::CVertex* vertex = m_spawn_graph->vertex (spawn_id);
132- SPAWN_GRAPH::const_iterator I = vertex->edges ().begin ();
133- SPAWN_GRAPH::const_iterator E = vertex->edges ().end ();
131+ auto vertex = m_spawn_graph->vertex (spawn_id);
132+ auto I = vertex->edges ().begin ();
133+ auto E = vertex->edges ().end ();
134134 for (; I != E; ++I)
135135 verify_spawns ((*I).vertex_id ());
136136}
@@ -217,7 +217,7 @@ void CGameSpawnConstructor::add_story_object(ALife::_STORY_ID id, CSE_ALifeDynam
217217 if (id == INVALID_STORY_ID)
218218 return ;
219219
220- ALife::STORY_P_PAIR_IT I = m_story_objects.find (id);
220+ auto I = m_story_objects.find (id);
221221 if (I != m_story_objects.end ())
222222 {
223223 Msg (" Object %s, story id %d" , object->name_replace (), object->m_story_id );
@@ -240,10 +240,10 @@ void CGameSpawnConstructor::add_object(CSE_Abstract* object)
240240void CGameSpawnConstructor::remove_object (CSE_Abstract* object) { spawn_graph ().remove_vertex (object->m_tSpawnID ); }
241241void CGameSpawnConstructor::process_actor (LPCSTR start_level_name)
242242{
243- m_actor = 0 ;
243+ m_actor = nullptr ;
244244
245- LEVEL_SPAWN_STORAGE::iterator I = m_level_spawns.begin ();
246- LEVEL_SPAWN_STORAGE::iterator E = m_level_spawns.end ();
245+ auto I = m_level_spawns.begin ();
246+ auto E = m_level_spawns.end ();
247247 for (; I != E; ++I)
248248 {
249249 if (!(*I)->actor ())
@@ -263,18 +263,18 @@ void CGameSpawnConstructor::process_actor(LPCSTR start_level_name)
263263 if (!xr_strcmp (*actor_level_name (), start_level_name))
264264 return ;
265265
266- const CGameGraph::SLevel & level = game_graph ().header ().level (start_level_name);
267- GameGraph::_GRAPH_ID dest = GameGraph::_GRAPH_ID (-1 );
266+ const auto & level = game_graph ().header ().level (start_level_name);
267+ auto dest = GameGraph::_GRAPH_ID (-1 );
268268 GraphEngineSpace::CGameLevelParams evaluator (level.id ());
269- CGraphEngine* graph_engine = new CGraphEngine (game_graph ().header ().vertex_count ());
269+ auto graph_engine = new CGraphEngine (game_graph ().header ().vertex_count ());
270270
271- bool failed = !graph_engine->search (game_graph (), m_actor->m_tGraphID , GameGraph::_GRAPH_ID (-1 ), 0 , evaluator);
271+ bool failed = !graph_engine->search (game_graph (), m_actor->m_tGraphID , GameGraph::_GRAPH_ID (-1 ), nullptr , evaluator);
272272 if (failed)
273273 {
274274 Msg (" ! Cannot build path via game graph from the current level to the level %s!" , start_level_name);
275275 float min_dist = flt_max;
276- Fvector current = game_graph ().vertex (m_actor->m_tGraphID )->game_point ();
277- GameGraph::_GRAPH_ID n = game_graph ().header ().vertex_count ();
276+ auto current = game_graph ().vertex (m_actor->m_tGraphID )->game_point ();
277+ auto n = game_graph ().header ().vertex_count ();
278278 for (GameGraph::_GRAPH_ID i = 0 ; i < n; ++i)
279279 {
280280 if (game_graph ().vertex (i)->level_id () == level.id ())
@@ -308,7 +308,7 @@ void clear_temp_folder()
308308 string_path query;
309309 FS.update_path (query, " $app_data_root$" , " temp\\ *.*" );
310310 _finddata_t file;
311- intptr_t handle = _findfirst (query, &file);
311+ auto handle = _findfirst (query, &file);
312312 if (handle == intptr_t (-1 ))
313313 return ;
314314
0 commit comments