diff options
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r-- | src/map/atcommand.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 78cd7a6a9..d4353a5ab 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -8,6 +8,7 @@ #include "../common/core.h" #include "../common/showmsg.h" #include "../common/malloc.h" +#include "../common/random.h" #include "../common/socket.h" #include "../common/strlib.h" #include "../common/utils.h" @@ -2600,11 +2601,11 @@ ACMD_FUNC(monstersmall) for (i = 0; i < number; i++) { int mx, my; if (x <= 0) - mx = sd->bl.x + (rand() % 11 - 5); + mx = sd->bl.x + (rnd() % 11 - 5); else mx = x; if (y <= 0) - my = sd->bl.y + (rand() % 11 - 5); + my = sd->bl.y + (rnd() % 11 - 5); else my = y; count += (mob_once_spawn(sd, sd->bl.m, mx, my, name, mob_id, 1, "2") != 0) ? 1 : 0; @@ -2676,11 +2677,11 @@ ACMD_FUNC(monsterbig) for (i = 0; i < number; i++) { int mx, my; if (x <= 0) - mx = sd->bl.x + (rand() % 11 - 5); + mx = sd->bl.x + (rnd() % 11 - 5); else mx = x; if (y <= 0) - my = sd->bl.y + (rand() % 11 - 5); + my = sd->bl.y + (rnd() % 11 - 5); else my = y; count += (mob_once_spawn(sd, sd->bl.m, mx, my, name, mob_id, 1, "4") != 0) ? 1 : 0; @@ -5137,7 +5138,7 @@ ACMD_FUNC(jail) return -1; } - switch(rand() % 2) { //Jail Locations + switch(rnd() % 2) { //Jail Locations case 0: m_index = mapindex_name2id(MAP_JAIL); x = 24; @@ -5291,7 +5292,7 @@ ACMD_FUNC(jailfor) } //Jail locations, add more as you wish. - switch(rand()%2) + switch(rnd()%2) { case 1: //Jail #1 m_index = mapindex_name2id(MAP_JAIL); @@ -8257,8 +8258,8 @@ ACMD_FUNC(clone) } do { - x = sd->bl.x + (rand() % 10 - 5); - y = sd->bl.y + (rand() % 10 - 5); + x = sd->bl.x + (rnd() % 10 - 5); + y = sd->bl.y + (rnd() % 10 - 5); } while (map_getcell(sd->bl.m,x,y,CELL_CHKNOPASS) && i++ < 10); if (i >= 10) { |