Fix WI reloading on slash commands

This commit is contained in:
Wolfsblvt 2024-07-28 04:17:45 +02:00
parent 87e562b752
commit d46fd9d174
1 changed files with 1 additions and 1 deletions

View File

@ -893,7 +893,7 @@ function registerWorldInfoSlashCommands() {
* @param {boolean} [loadIfNotSelected=false] - Indicates whether to load the file even if it's not currently selected
*/
function reloadEditor(file, loadIfNotSelected = false) {
const currentIndex = $('#world_editor_select').val();
const currentIndex = Number($('#world_editor_select').val());
const selectedIndex = world_names.indexOf(file);
if (selectedIndex !== -1 && (loadIfNotSelected || currentIndex === selectedIndex)) {
$('#world_editor_select').val(selectedIndex).trigger('change');