Fixes for invasions and terrain generation.

This commit is contained in:
Storm Dragon
2026-01-18 11:51:42 -05:00
parent 764eab45e4
commit 95a3f4a96c
3 changed files with 32 additions and 0 deletions
+26
View File
@@ -251,6 +251,32 @@ void perform_search(int current_x)
}
}
// Stream banks - Clay (within stream sound range, but not in water)
bool near_stream_bank = false;
for (uint i = 0; i < world_streams.length(); i++) {
if (world_streams[i].contains_position(current_x)) {
continue;
}
int center = world_streams[i].get_center_position();
int distance = center - current_x;
if (distance < 0) distance = -distance;
if (distance <= 3) {
near_stream_bank = true;
break;
}
}
if (near_stream_bank) {
if (inv_clay < MAX_ITEM_STACK) {
inv_clay++;
p.play_stationary("sounds/items/clay.ogg", false);
screen_reader_speak("Found clay.", true);
} else {
screen_reader_speak("You can't carry any more clay.", true);
}
return;
}
// Trees (Sticks/Vines) - Check for nearby tree anywhere
Tree@ nearest = null;
int nearest_distance = 999;