From 5723f10cc35c2832257c24eb5db3a7ca7937fe24 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 25 Dec 2016 19:37:07 +0100 Subject: [PATCH] - use 'for' iterator syntax to check touching_renderlists. --- src/p_map.cpp | 4 +--- src/r_things.cpp | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/p_map.cpp b/src/p_map.cpp index 517327843..e90d24bed 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -6707,10 +6707,8 @@ void P_UnlinkRenderSectors(AActor* thing) { if (thing->touching_render_sectors) { - for (std::forward_list::iterator it = thing->touching_render_sectors->begin(); - it != thing->touching_render_sectors->end(); it++) + for (auto sec : *thing->touching_render_sectors) { - sector_t* sec = (*it); if (sec->touching_render_things) { sec->touching_render_things->remove(thing); diff --git a/src/r_things.cpp b/src/r_things.cpp index 77f45188c..4cf056aed 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -1234,10 +1234,8 @@ void R_AddSprites (sector_t *sec, int lightlevel, int fakeside) spriteshade = LIGHT2SHADE(lightlevel + r_actualextralight); // Handle all things in sector. - for (std::forward_list::iterator it = sec->touching_render_things->begin(); - it != sec->touching_render_things->end(); it++) + for (auto thing : *sec->touching_render_things) { - thing = (*it); if (thing->validcount == validcount) continue; thing->validcount = validcount;