summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/plugins/matrix.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/plugins/matrix.c b/apps/plugins/matrix.c
index 087a501474..1b2f6d465a 100644
--- a/apps/plugins/matrix.c
+++ b/apps/plugins/matrix.c
@@ -166,7 +166,7 @@ static void matrix_loop(void)
166*/ 166*/
167 /* A little more random now for spaces */ 167 /* A little more random now for spaces */
168 if (rb->rand() % randomness == 1){ 168 if (rb->rand() % randomness == 1){
169 while (i <= ROWS && (matrix[i][j].val == 129 || 169 while (i < ROWS && (matrix[i][j].val == 129 ||
170 matrix[i][j].val == -1)){ 170 matrix[i][j].val == -1)){
171 i++; 171 i++;
172 randomness--; 172 randomness--;
@@ -179,19 +179,19 @@ static void matrix_loop(void)
179 } 179 }
180 180
181 181
182 if (i > ROWS) 182 if (i >= ROWS)
183 break; 183 break;
184 184
185 /* Go to the head of this collumn */ 185 /* Go to the head of this collumn */
186 z = i; 186 z = i;
187 y = 0; 187 y = 0;
188 while (i <= ROWS && (matrix[i][j].val != 129 && 188 while (i < ROWS && (matrix[i][j].val != 129 &&
189 matrix[i][j].val != -1)) { 189 matrix[i][j].val != -1)) {
190 i++; 190 i++;
191 y++; 191 y++;
192 } 192 }
193 193
194 if (i > ROWS) { 194 if (i >= ROWS) {
195 matrix[z][j].val = 129; 195 matrix[z][j].val = 129;
196 matrix[ROWS - 1][j].bold = 1; 196 matrix[ROWS - 1][j].bold = 1;
197 matrix_blit_char(z - 1, j, matrix[z][j].val); 197 matrix_blit_char(z - 1, j, matrix[z][j].val);
@@ -200,7 +200,7 @@ static void matrix_loop(void)
200 200
201 matrix[i][j].val = rb->rand() % (MAXCHARS-1) + 1; 201 matrix[i][j].val = rb->rand() % (MAXCHARS-1) + 1;
202 202
203 if (matrix[i - 1][j].bold == 2) { 203 if (i > 0 && matrix[i - 1][j].bold == 2) {
204 matrix[i - 1][j].bold = 1; 204 matrix[i - 1][j].bold = 1;
205 matrix[i][j].bold = 2; 205 matrix[i][j].bold = 2;
206 } 206 }