aboutsummaryrefslogtreecommitdiff
path: root/Canvas.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-10-13 21:51:08 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-10-13 21:51:08 +0200
commit212734b31102b11f4819c6676270baa1c99ea27b (patch)
tree34824491dc1be973ead0005a6b849daa9ecbb296 /Canvas.cpp
parentc4f08b23bfc6832e3158e2f15fd6bfd15c04eab6 (diff)
use std::list instead of std::vector for storing artists + identify some instability causes
Diffstat (limited to 'Canvas.cpp')
-rw-r--r--Canvas.cpp9
1 files changed, 4 insertions, 5 deletions
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);
}
}