Browse Source

Fixed an error in the nogame screen if the window's height is too small.

Alex Szpakowski 9 years ago
parent
commit
5ef0195a88
2 changed files with 19 additions and 15 deletions
  1. 7 5
      src/scripts/nogame.lua
  2. 12 10
      src/scripts/nogame.lua.h

+ 7 - 5
src/scripts/nogame.lua

@@ -867,11 +867,13 @@ function love.nogame()
 				local c = str:sub(i, i)
 				if c ~= " " then
 					local piece = self.pieces[idx + i]
-					piece.quad = GLYPHS[c]
-					piece.r = 0
-					piece.rv = 0
-					piece.color.prev = INITIAL_TEXT_COLOR
-					piece.color.next = INITIAL_TEXT_COLOR
+					if piece then
+						piece.quad = GLYPHS[c]
+						piece.r = 0
+						piece.rv = 0
+						piece.color.prev = INITIAL_TEXT_COLOR
+						piece.color.next = INITIAL_TEXT_COLOR
+					end
 				end
 			end
 		end

+ 12 - 10
src/scripts/nogame.lua.h

@@ -3434,16 +3434,18 @@ const unsigned char nogame_lua[] =
 	0x09, 0x09, 0x09, 0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x70, 0x69, 0x65, 0x63, 0x65, 0x20, 0x3d, 
 	0x20, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x70, 0x69, 0x65, 0x63, 0x65, 0x73, 0x5b, 0x69, 0x64, 0x78, 0x20, 0x2b, 
 	0x20, 0x69, 0x5d, 0x0a,
-	0x09, 0x09, 0x09, 0x09, 0x09, 0x70, 0x69, 0x65, 0x63, 0x65, 0x2e, 0x71, 0x75, 0x61, 0x64, 0x20, 0x3d, 0x20, 
-	0x47, 0x4c, 0x59, 0x50, 0x48, 0x53, 0x5b, 0x63, 0x5d, 0x0a,
-	0x09, 0x09, 0x09, 0x09, 0x09, 0x70, 0x69, 0x65, 0x63, 0x65, 0x2e, 0x72, 0x20, 0x3d, 0x20, 0x30, 0x0a,
-	0x09, 0x09, 0x09, 0x09, 0x09, 0x70, 0x69, 0x65, 0x63, 0x65, 0x2e, 0x72, 0x76, 0x20, 0x3d, 0x20, 0x30, 0x0a,
-	0x09, 0x09, 0x09, 0x09, 0x09, 0x70, 0x69, 0x65, 0x63, 0x65, 0x2e, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x70, 
-	0x72, 0x65, 0x76, 0x20, 0x3d, 0x20, 0x49, 0x4e, 0x49, 0x54, 0x49, 0x41, 0x4c, 0x5f, 0x54, 0x45, 0x58, 0x54, 
-	0x5f, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x0a,
-	0x09, 0x09, 0x09, 0x09, 0x09, 0x70, 0x69, 0x65, 0x63, 0x65, 0x2e, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x6e, 
-	0x65, 0x78, 0x74, 0x20, 0x3d, 0x20, 0x49, 0x4e, 0x49, 0x54, 0x49, 0x41, 0x4c, 0x5f, 0x54, 0x45, 0x58, 0x54, 
-	0x5f, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x0a,
+	0x09, 0x09, 0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x70, 0x69, 0x65, 0x63, 0x65, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
+	0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x70, 0x69, 0x65, 0x63, 0x65, 0x2e, 0x71, 0x75, 0x61, 0x64, 0x20, 0x3d, 
+	0x20, 0x47, 0x4c, 0x59, 0x50, 0x48, 0x53, 0x5b, 0x63, 0x5d, 0x0a,
+	0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x70, 0x69, 0x65, 0x63, 0x65, 0x2e, 0x72, 0x20, 0x3d, 0x20, 0x30, 0x0a,
+	0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x70, 0x69, 0x65, 0x63, 0x65, 0x2e, 0x72, 0x76, 0x20, 0x3d, 0x20, 0x30, 0x0a,
+	0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x70, 0x69, 0x65, 0x63, 0x65, 0x2e, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 
+	0x70, 0x72, 0x65, 0x76, 0x20, 0x3d, 0x20, 0x49, 0x4e, 0x49, 0x54, 0x49, 0x41, 0x4c, 0x5f, 0x54, 0x45, 0x58, 
+	0x54, 0x5f, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x0a,
+	0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x70, 0x69, 0x65, 0x63, 0x65, 0x2e, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 
+	0x6e, 0x65, 0x78, 0x74, 0x20, 0x3d, 0x20, 0x49, 0x4e, 0x49, 0x54, 0x49, 0x41, 0x4c, 0x5f, 0x54, 0x45, 0x58, 
+	0x54, 0x5f, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x0a,
+	0x09, 0x09, 0x09, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
 	0x09, 0x09, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
 	0x09, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
 	0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,