mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-11 20:07:24 +00:00
Fix bug #14239 - check for shrouded/fogged sound sources...
...in calculate_volume - that's the single point where it actually matters.
This commit is contained in:
parent
7d2d62cb33
commit
36db0e4cdb
@ -10,6 +10,7 @@ Version 1.7.5+svn:
|
||||
* Updated translations: Czech, Estonian, French, Spanish.
|
||||
* Music and sound effects:
|
||||
* Added new music track, "Into the Shadows" by Tyler Johnson
|
||||
* Fixed bug #14239 (check_fogged ignored by sound sources)
|
||||
* User interface:
|
||||
* new gamestate inspector debug dialog (via 'inspect' command
|
||||
and '[inspect]' tag)
|
||||
|
@ -189,9 +189,6 @@ void positional_source::update_positions(unsigned int time, const display &disp)
|
||||
|
||||
int distance_volume = DISTANCE_SILENT;
|
||||
for(std::vector<map_location>::iterator i = locations_.begin(); i != locations_.end(); ++i) {
|
||||
if(disp.shrouded(*i) || (check_fogged_ && disp.fogged(*i)))
|
||||
continue;
|
||||
|
||||
int v = calculate_volume(*i, disp);
|
||||
if(v < distance_volume) {
|
||||
distance_volume = v;
|
||||
@ -210,6 +207,9 @@ int positional_source::calculate_volume(const map_location &loc, const display &
|
||||
assert(range_ > 0);
|
||||
assert(faderange_ > 0);
|
||||
|
||||
if(disp.shrouded(loc) || (check_fogged_ && disp.fogged(loc)))
|
||||
return DISTANCE_SILENT;
|
||||
|
||||
SDL_Rect area = disp.map_area();
|
||||
map_location center = disp.hex_clicked_on(area.x + area.w / 2, area.y + area.h / 2);
|
||||
size_t distance = distance_between(loc, center);
|
||||
|
Loading…
x
Reference in New Issue
Block a user