1
Fork 0
mirror of https://github.com/Steffo99/iiiiil-gioco.git synced 2024-11-25 17:34:18 +00:00

Impedito la creazione di stanze lungo i bordi.

This commit is contained in:
Steffo 2015-12-27 21:40:59 +01:00
parent 55c5bae030
commit 065215ab27

View file

@ -124,8 +124,8 @@ void generate(char map[X_MAX][Y_MAX])
{ {
int size_x = rand() % ROOM_SIZE + 1; int size_x = rand() % ROOM_SIZE + 1;
int size_y = rand() % ROOM_SIZE + 1; int size_y = rand() % ROOM_SIZE + 1;
int start_x = rand() % (X_MAX - size_x); int start_x = rand() % (X_MAX - size_x - 2) + 1;
int start_y = rand() % (Y_MAX - size_y); int start_y = rand() % (Y_MAX - size_y - 2) + 1;
room(map, start_x, start_y, start_x + size_x, start_y + size_y); room(map, start_x, start_y, start_x + size_x, start_y + size_y);
if(r > 0) if(r > 0)
{ {