Merge branch 'master' of https://git.tagachop.fr/epicsparrow/PixelWars
This commit is contained in:
commit
f61e4c63e4
22
main.c
22
main.c
@ -93,6 +93,28 @@ int getNear(int dir){
|
|||||||
return map[coord.x][coord.y].type;
|
return map[coord.x][coord.y].type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int getInfo(int dir){
|
||||||
|
t_coord coord = getPos(current_dude->pos, dir);
|
||||||
|
t_pixel pixel = map[coord.x][coord.y];
|
||||||
|
t_dude* dude;
|
||||||
|
int* n;
|
||||||
|
switch(pixel.type){
|
||||||
|
case DUDE :
|
||||||
|
dude = pixel.data;
|
||||||
|
return dude->team;
|
||||||
|
case FOOD :
|
||||||
|
case WOOD :
|
||||||
|
case STONE :
|
||||||
|
case IRON :
|
||||||
|
case SWORD :
|
||||||
|
case SPAWN :
|
||||||
|
n = pixel.data;
|
||||||
|
return *n;
|
||||||
|
default :
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int getInventory(){
|
int getInventory(){
|
||||||
return current_dude->inventory;
|
return current_dude->inventory;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user