Created
September 26, 2010 04:25
-
-
Save zc00gii/597601 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int try_move(int i, int x, int y, int nx, int ny) | |
{ | |
unsigned r; | |
if(nx<0 || ny<0 || nx>=XRES || ny>=YRES) | |
return 0; | |
if(x==nx && y==ny) | |
return 1; | |
r = pmap[ny][nx]; | |
if(r && (r>>8)<NPART) | |
r = (r&~0xFF) | parts[r>>8].type; | |
if(parts[i].type==PT_PHOT&&((r&0xFF)==PT_GLAS||(r&0xFF)==PT_PHOT||(r&0xFF)==PT_CLNE||((r&0xFF)==PT_LCRY&&parts[r>>8].life > 5))) | |
{ | |
return 1; | |
} | |
if((r&0xFF)==PT_VOID) | |
{ | |
parts[i].type=PT_NONE; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment