From 57d69015c237c5d0edb3e1291aa8d34456488eeb Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Sat, 28 Jun 2025 11:38:06 -0400 Subject: [PATCH] Renamed to random_walk since that's what it called. Closes #26. --- map.cpp | 2 +- map.hpp | 3 +-- systems.cpp | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/map.cpp b/map.cpp index 66c8dd9..04a4e7d 100644 --- a/map.cpp +++ b/map.cpp @@ -118,7 +118,7 @@ Point Map::center_camera(const Point &around, size_t view_x, size_t view_y) { * drunkenly gradually reaching the player, and dodging * in and out. */ -bool Map::neighbors(Point &out, bool random, int direction) { +bool Map::random_walk(Point &out, bool random, int direction) { return $paths.random_walk(out, random, direction); } diff --git a/map.hpp b/map.hpp index dc5f1fa..305682d 100644 --- a/map.hpp +++ b/map.hpp @@ -50,8 +50,7 @@ public: bool inmap(size_t x, size_t y); bool iswall(size_t x, size_t y); bool can_move(Point move_to); - // BUG: this isn't really neighbors anymore. Maybe move? Walk? - bool neighbors(Point &out, bool random=false, int direction=PATHING_TOWARD); + bool random_walk(Point &out, bool random=false, int direction=PATHING_TOWARD); void make_paths(); void set_target(const Point &at, int value=0); diff --git a/systems.cpp b/systems.cpp index 283d2ff..d1cfee5 100644 --- a/systems.cpp +++ b/systems.cpp @@ -89,9 +89,9 @@ void System::enemy_pathing(GameLevel &level) { Point out = position.location; // copy if(enemy_ai.wants_to("find_enemy")) { - map.neighbors(out, motion.random, PATHING_TOWARD); + map.random_walk(out, motion.random, PATHING_TOWARD); } else if(enemy_ai.wants_to("run_away")) { - map.neighbors(out, motion.random, PATHING_AWAY); + map.random_walk(out, motion.random, PATHING_AWAY); } motion = { int(out.x - position.location.x), int(out.y - position.location.y)};