Преглед изворни кода

You now get an error when there is no code to run

[email protected] пре 15 година
родитељ
комит
3c79a33931
2 измењених фајлова са 779 додато и 764 уклоњено
  1. 9 1
      src/scripts/boot.lua
  2. 770 763
      src/scripts/boot.lua.h

+ 9 - 1
src/scripts/boot.lua

@@ -179,6 +179,10 @@ function love.boot()
 		can_has_game = pcall(love.filesystem.setSource, full_source)
 		can_has_game = pcall(love.filesystem.setSource, full_source)
 	end
 	end
 
 
+	if can_has_game and not (love.filesystem.exists("main.lua") or love.filesystem.exists("conf.lua")) then
+		no_game_code = true
+	end
+
 	if not can_has_game then
 	if not can_has_game then
 		love.filesystem = nil
 		love.filesystem = nil
 		love.nogame()
 		love.nogame()
@@ -255,6 +259,10 @@ function love.init()
 
 
 	if love.filesystem and love.filesystem.exists("main.lua") then require("main.lua") end
 	if love.filesystem and love.filesystem.exists("main.lua") then require("main.lua") end
 
 
+	if no_game_code then
+		error("No code to run\nYour game might be packaged incorrectly\nMake sure main.lua is at the top level of the zip")
+	end
+
 	-- Console hack
 	-- Console hack
 	if c.console and love._openConsole then
 	if c.console and love._openConsole then
 		love._openConsole()
 		love._openConsole()
@@ -265,7 +273,7 @@ end
 function love.run()
 function love.run()
 
 
 	if love.load then love.load() end
 	if love.load then love.load() end
-	
+
 	local dt = 0
 	local dt = 0
 
 
 	-- Main loop time.
 	-- Main loop time.

Разлика између датотеке није приказан због своје велике величине
+ 770 - 763
src/scripts/boot.lua.h


Неке датотеке нису приказане због велике количине промена