lua: Fix wesnoth.audio.volume always setting the volume to 0

This commit is contained in:
Iris Morelle 2021-10-05 12:22:02 -03:00
parent 24a11e4404
commit 9c2ad49026
No known key found for this signature in database
GPG key ID: E312033F4023A753
2 changed files with 2 additions and 1 deletions

View file

@ -5,6 +5,7 @@
### Editor
### Multiplayer
### Lua API
* Fixed `wesnoth.audio.volume = N` always setting volume to 0.
### Packaging
### Terrain
### Translations

View file

@ -497,7 +497,7 @@ static int impl_audio_set(lua_State* L)
return 0;
}
int vol = preferences::sound_volume();
float rel = lua_tonumber(L, 2);
float rel = lua_tonumber(L, 3);
if(rel < 0.0f || rel > 100.0f) {
return luaL_argerror(L, 1, "volume must be in range 0..100");
}