Bugfix: bgm tracks weren't saved properly

This commit is contained in:
Zughy 2020-12-01 23:10:19 +01:00
parent 0a7655b233
commit cd9cf85b33
2 changed files with 3 additions and 3 deletions

View File

@ -55,7 +55,7 @@ An arena is a table having as a key an ID and as a value its parameters. They ar
* `min_players`: (string) default is 2. When this value is reached, a queue starts
* `initial_time`: (int) in seconds. It's `nil` when the mod doesn't keep track of time, it's 0 when the mod does it incrementally and it's inherited by the mod if the mod has a timer. In this case, every arena can have its specific value. By default time tracking is disabled, hence it's `nil`
* `current_time`: (int) in seconds. It requires `initial_time` and it exists only when a game is in progress, keeping track of the current time
* `bgm`: (table) contains the information about the audio track to play while in game. Audio tracks must be placed in the minigame `/sounds` path (not arena_lib's) in order to be found
* `bgm`: (table) contains the information about the audio track to play while in game. Audio tracks must be placed in the minigame `/sounds` path (not arena_lib's) in order to be found. Default is `nil`
* `in_queue`: (bool) about phases, look at "Arena phases" down below
* `in_loading`: (bool)
* `in_game`: (bool)
@ -158,7 +158,7 @@ ChatCmdBuilder.new("NAMEOFYOURCOMMAND", function(cmd)
`arena_lib.set_sign(sender, <pos, remove>, <mod, arena_name>)` via chat uses `sender`, `mod` and `arena_name`, while the editor `pos` and `remove` (hence the weird subdivision). When used via chat, it takes the block the player is pointing at in a 5 blocks radius. If the block is a sign, it then creates (or remove if already set) the "arena sign".
##### 1.2.2.7 Music
`arena_lib.set_bgm(sender, mod, arena_name, track, volume, pitch)` sets the background music of the arena. The audio file (`track`) must be inside the `sounds` folder of the minigame mod (NOT arena_lib's), and `.ogg` shall be omitted from the string
`arena_lib.set_bgm(sender, mod, arena_name, track, volume, pitch)` sets the background music of the arena. The audio file (`track`) must be inside the `sounds` folder of the minigame mod (NOT arena_lib's), and `.ogg` shall be omitted from the string. If `track` is nil, `arena.bgm` will be set to `nil` too
#### 1.2.3 Enabling an arena
When a sign has been set, it won't work. This because an arena must be enabled manually via

View File

@ -810,7 +810,7 @@ function arena_lib.set_bgm(sender, mod, arena_name, track, volume, pitch, in_edi
if not ARENA_LIB_EDIT_PRECHECKS_PASSED(sender, arena) then return end
end
if bgm == nil then
if track == nil then
arena.bgm = nil
else
arena.bgm = {