From 212734b31102b11f4819c6676270baa1c99ea27b Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Sun, 13 Oct 2024 21:51:08 +0200 Subject: use std::list instead of std::vector for storing artists + identify some instability causes --- Canvas.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'Canvas.cpp') diff --git a/Canvas.cpp b/Canvas.cpp index 821be0c..4b326c7 100644 --- a/Canvas.cpp +++ b/Canvas.cpp @@ -75,12 +75,11 @@ string Canvas::to_string(bool truecolor) { } void Canvas::update_steps() { - for (size_t i = 0; i < this->museum.people.artists_size(); i++) { - Artist & artist = this->museum.people.get_artist(i); - if (artist.step == false) continue; - artist.step = false; + for (Artist * artist : this->museum.people.get_artists()) { + if (artist->step == false) continue; + artist->step = false; - this->get_tile(artist.data.x, artist.data.y).step(artist); + this->get_tile(artist->data.x, artist->data.y).step(*artist); } } -- cgit v1.2.3