diff options
| -rw-r--r-- | src/world.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/world.c b/src/world.c index 88ef7c6..e80f195 100644 --- a/src/world.c +++ b/src/world.c @@ -1320,7 +1320,7 @@ static bool world_check_location_accessibility(world_location* orig, world_locat if (destination == source) continue;
if (destination == orig) continue;
- if (destination->is_owned && world_get_max_depth_for_location(orig) >= depth) {
+ if (destination->is_owned && world_get_max_depth_for_location(destination) >= depth) {
return true;
}
else if (distance_between_location(destination, orig) > dist){
@@ -1357,6 +1357,7 @@ world_update_result world_render(platform_window* window, world* world) s32 circle_y = location->map_position_y - dotsize/2;
bool hovered = mouse_interacts(circle_x, circle_y, dotsize, dotsize);
location->is_accessible = world_check_location_accessibility(location, location, 1, 0);
+
location->is_hovered = hovered;
if (hovered && location->is_accessible) {
platform_set_cursor(window, CURSOR_POINTER);
@@ -1403,8 +1404,6 @@ world_update_result world_render(platform_window* window, world* world) for (s32 i = 0; i < world->locations.length; i++)
{
world_location* source = array_at(&world->locations, i);
-
-
for (s32 d = 0; d < source->connections.length; d++)
{
world_location* destination = *(world_location**)array_at(&source->connections, d);
@@ -1412,6 +1411,7 @@ world_update_result world_render(platform_window* window, world* world) color line_clr = COLOR_CONNECTION_BETWEEN_LOCATION_ACCESSIBLE;
if (!source->is_accessible) line_clr = COLOR_CONNECTION_BETWEEN_LOCATION_INACCESSIBLE;
+ if (!destination->is_accessible) line_clr = COLOR_CONNECTION_BETWEEN_LOCATION_INACCESSIBLE;
renderer->render_line(source->map_position_x, source->map_position_y, destination->map_position_x, destination->map_position_y, 2, line_clr);
}
}
|
