From b8bed26bbc593a707e68bec33923be21396b9687 Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Mon, 14 Oct 2019 22:52:48 +0200 Subject: using good ol' failsafe for-loop instead of an iterator based foreach approach w/ exceptions --- GdiRadarLib/GdiRadar.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'GdiRadarLib') diff --git a/GdiRadarLib/GdiRadar.cpp b/GdiRadarLib/GdiRadar.cpp index 54ce479..7e3ca63 100644 --- a/GdiRadarLib/GdiRadar.cpp +++ b/GdiRadarLib/GdiRadar.cpp @@ -142,9 +142,11 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM l { (LONG)drawing->GameMapWindowWidth, (LONG)drawing->GameMapWindowHeight }, { 0, (LONG)drawing->GameMapWindowHeight }, { 0,0 } }; Polyline(drawing->hdc, lines, 5); - for (auto& entity : wnd_ctx->entities) { - draw_entity(wnd_ctx, &entity); + + for (size_t i = 0; i < wnd_ctx->entities.size(); ++i) { + draw_entity(wnd_ctx, &wnd_ctx->entities.at(i)); } + EndPaint(hwnd, &ps); wnd_ctx->lastTimeUpdated = clock(); -- cgit v1.2.3