Skip to content

Commit

Permalink
fix dumb level jsons
Browse files Browse the repository at this point in the history
  • Loading branch information
Bauumm committed Oct 27, 2024
1 parent da1a899 commit 345fc72
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compat/game20/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public.start = async(function(pack_id, level_id, level_options)
lua_runtime.run_fn_if_exists("onUnload")
end
lua_runtime.init_env(game, public, assets)
lua_runtime.run_lua_file(game.pack.path .. level.luaFile)
lua_runtime.run_lua_file(game.pack.path .. level.lua_file)
lua_runtime.run_fn_if_exists("onInit")
lua_runtime.run_fn_if_exists("onLoad")
game.set_sides(level_status.sides)
Expand Down
2 changes: 1 addition & 1 deletion compat/game21/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public.start = async(function(pack_id, level_id, level_options)
lua_runtime.run_fn_if_exists("onPreUnload")
end
lua_runtime.init_env(game, public)
lua_runtime.run_lua_file(game.pack_data.path .. game.level_data.luaFile)
lua_runtime.run_lua_file(game.pack_data.path .. game.level_data.lua_file)
if public.first_play then
playsound(select_sound)
else
Expand Down
11 changes: 11 additions & 0 deletions game_handler/assets.lua
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,17 @@ local function preload_pack(pack_folder_name, version, persistent_data)

-- default
level_json.id = level_json.id or "nullId"
level_json.name = level_json.name or "nullName"
level_json.description = level_json.description or ""
level_json.author = level_json.author or ""
level_json.menu_priority = level_json.menu_priority or 0
if level_json.selectable == nil then
level_json.selectable = true
end
level_json.music_id = level_json.music_id or "nullMusicId"
level_json.sound_id = level_json.sound_id or "nullSoundId"
level_json.style_id = level_json.style_id or "nullStyleId"
level_json.lua_file = level_json.lua_file or "nullLuaPath"
level_json.difficulty_mults = level_json.difficulty_mults or {}
-- add 1x difficulty mult if it doesn't exist
local has1 = false
Expand Down

0 comments on commit 345fc72

Please sign in to comment.