- for (player.y = player.x = 0; 0 == is_passable(&map, player.y, player.x);) {
- player.y = rrand(0, 0) % map.height;
- player.x = rrand(0, 0) % map.width; }
- for (monster.y = monster.x = 0; 0 == is_passable(&map, monster.y, monster.x);) {
- monster.y = rrand(0, 0) % map.height;
- monster.x = rrand(0, 0) % map.width; } }
+ for (player.pos.y = player.pos.x = 0; 0 == is_passable(&map, player.pos.y, player.pos.x);) {
+ player.pos.y = rrand(0, 0) % map.height;
+ player.pos.x = rrand(0, 0) % map.width; }
+ struct Monster * monster;
+ for (monster = world.monster; monster != 0; monster = monster->next)
+ for (monster->pos.y = monster->pos.x = 0; 0 == is_passable(&map, monster->pos.y, monster->pos.x);) {
+ monster->pos.y = rrand(0, 0) % map.height;
+ monster->pos.x = rrand(0, 0) % map.width; } }