Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:goupilmtos:2024:games
black-box
black-box-1.4.8-range.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File black-box-1.4.8-range.patch of Package black-box
Index: src/blackbox.c =================================================================== --- src/blackbox.c.orig +++ src/blackbox.c @@ -410,26 +410,26 @@ output calc_out(char map[12][9],int x,in { case 0: if (y==0) {end=1;} else - if (map[x-1][y-1]==1) {dir=1;} else - if (map[x][y-1]==1) {dir=3;} + if (x!=0&&map[x-1][y-1]==1) {dir=1;} else + if (x<10&&map[x][y-1]==1) {dir=3;} else {y--;} break; case 1: - if (x==12) {end=1;} else - if (map[x][y]==1) {dir=0;} else - if (map[x][y-1]==1) {dir=2;} + if (x==11) {end=1;} else + if (y<8&&map[x][y]==1) {dir=0;} else + if (y!=0&&map[x][y-1]==1) {dir=2;} else {x++;} break; case 2: if (y==9) {end=1;} else - if (map[x][y]==1) {dir=3;} else - if (map[x-1][y]==1) {dir=1;} + if (x<10&&map[x][y]==1) {dir=3;} else + if (x!=0&&map[x-1][y]==1) {dir=1;} else {y++;} break; case 3: if (x==0) {end=1;} else - if (map[x-1][y]==1) {dir=0;} else - if (map[x-1][y-1]==1) {dir=2;} + if (y<8&&map[x-1][y]==1) {dir=0;} else + if (y!=0&&map[x-1][y-1]==1) {dir=2;} else {x--;} break; } @@ -746,15 +746,15 @@ void click() { //block highlighting case SDL_BUTTON(3): - if ((light[div(mouse_x+25,50).quot-2][div(mouse_y+25,50).quot-2]==0) - &&(div(mouse_x+25,50).quot>1)&&(div(mouse_y+25,50).quot>1) - &&(div(mouse_x+25,50).quot<13)&&(div(mouse_y+25,50).quot<11)) + if ((div(mouse_x+25,50).quot>1)&&(div(mouse_y+25,50).quot>1) + &&(div(mouse_x+25,50).quot<13)&&(div(mouse_y+25,50).quot<11) + &&(light[div(mouse_x+25,50).quot-2][div(mouse_y+25,50).quot-2]==0)) { light[div(mouse_x+25,50).quot-2][div(mouse_y+25,50).quot-2]=1; }else - if ((light[div(mouse_x+25,50).quot-2][div(mouse_y+25,50).quot-2]==1) - &&(div(mouse_x+25,50).quot>1)&&(div(mouse_y+25,50).quot>1) - &&(div(mouse_x+25,50).quot<13)&&(div(mouse_y+25,50).quot<11)) + if ((div(mouse_x+25,50).quot>1)&&(div(mouse_y+25,50).quot>1) + &&(div(mouse_x+25,50).quot<13)&&(div(mouse_y+25,50).quot<11) + &&(light[div(mouse_x+25,50).quot-2][div(mouse_y+25,50).quot-2]==1)) { light[div(mouse_x+25,50).quot-2][div(mouse_y+25,50).quot-2]=0; } @@ -801,15 +801,15 @@ void click() break; case SDL_BUTTON(1): //think - if ((think[div(mouse_x,50).quot-2][div(mouse_y,50).quot-2]==0) - &&(div(mouse_x,50).quot>1)&&(div(mouse_y,50).quot>1) - &&(div(mouse_x,50).quot<12)&&(div(mouse_y,50).quot<10)) + if ((div(mouse_x,50).quot>1)&&(div(mouse_y,50).quot>1) + &&(div(mouse_x,50).quot<12)&&(div(mouse_y,50).quot<10) + &&(think[div(mouse_x,50).quot-2][div(mouse_y,50).quot-2]==0)) { think[div(mouse_x,50).quot-2][div(mouse_y,50).quot-2]=1; } else - if ((think[div(mouse_x,50).quot-2][div(mouse_y,50).quot-2]==1) - &&(div(mouse_x,50).quot>1)&&(div(mouse_y,50).quot>1) - &&(div(mouse_x,50).quot<12)&&(div(mouse_y,50).quot<10)) + if ((div(mouse_x,50).quot>1)&&(div(mouse_y,50).quot>1) + &&(div(mouse_x,50).quot<12)&&(div(mouse_y,50).quot<10) + &&(think[div(mouse_x,50).quot-2][div(mouse_y,50).quot-2]==1)) { think[div(mouse_x,50).quot-2][div(mouse_y,50).quot-2]=0; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor