Changing the minimum amount of players doesn't reset the spawners anymore | Bugfix: an error was shown when editing the amount of players while in the editor (even if the action was performed)
parent
bbbfc6cab0
commit
f9cf57f12c
2
DOCS.md
2
DOCS.md
|
@ -299,7 +299,7 @@ Default is 0 and these are mostly hardcoded in arena_lib already, so it's advise
|
|||
|
||||
### 2.7 Things you don't want to do with a light heart
|
||||
* Changing the number of the teams: it'll delete your spawners (this has to be done in order to avoid further problems)
|
||||
* Any action in the "Players" section of the editor. It'll delete your spawners (same as above)
|
||||
* Changing the minimum amount of players aside, any action in the "Players" section of the editor. It'll delete your spawners (same as above)
|
||||
|
||||
## 3. About the author(s)
|
||||
I'm Zughy (Marco), a professional Italian pixel artist who fights for FOSS and digital ethics. If this library spared you a lot of time and you want to support me somehow, please consider donating on [LiberaPay](https://liberapay.com/Zughy/). Also, this project wouldn't have been possible if it hadn't been for some friends who helped me testing through: `SonoMichele`, `_Zaizen_` and `Xx_Crazyminer_xX`
|
||||
|
|
6
api.lua
6
api.lua
|
@ -370,8 +370,10 @@ function arena_lib.change_players_amount(sender, mod, arena_name, min_players, m
|
|||
arena.max_players = old_max_players
|
||||
return end
|
||||
|
||||
-- svuoto i vecchi spawner per evitare problemi
|
||||
arena_lib.set_spawner(sender, mod, arena_name, nil, "deleteall")
|
||||
-- se i giocatori massimi sono cambiati, svuoto i vecchi spawner per evitare problemi
|
||||
if max_players and old_max_players ~= max_players then
|
||||
arena_lib.set_spawner(sender, mod, arena_name, nil, "deleteall", nil, in_editor)
|
||||
end
|
||||
|
||||
update_storage(false, mod, id, arena)
|
||||
arena_lib.update_sign(arena)
|
||||
|
|
Loading…
Reference in New Issue