Linked the rooms east to west for movement commands
This commit is contained in:
parent
8d3254c5d6
commit
2b40943d14
1 changed files with 4 additions and 2 deletions
|
|
@ -10,9 +10,11 @@ Room* wrld__create() {
|
||||||
rooms[i].name = strbuf;
|
rooms[i].name = strbuf;
|
||||||
rooms[i].description = strbuf;
|
rooms[i].description = strbuf;
|
||||||
rooms[i].north = NULL;
|
rooms[i].north = NULL;
|
||||||
rooms[i].east = NULL;
|
if (i>0) // Link to previous room if exists
|
||||||
|
rooms[i].east = &rooms[i-1];
|
||||||
rooms[i].south = NULL;
|
rooms[i].south = NULL;
|
||||||
rooms[i].west = NULL;
|
if (i<WORLD_SIZE-1) // Link to next room if exists
|
||||||
|
rooms[i].west = &rooms[i-1];
|
||||||
}
|
}
|
||||||
|
|
||||||
return rooms;
|
return rooms;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue