Fixes for invasions and terrain generation.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user