summaryrefslogtreecommitdiff
path: root/src/map/mercenary.c
diff options
context:
space:
mode:
authortoms <toms@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-27 18:47:53 +0000
committertoms <toms@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-27 18:47:53 +0000
commit95edabf40aaa4b14c46d5e085360998f54c4dc69 (patch)
tree532b7c6da2de511b6e4bee3e29d0f9e90c248010 /src/map/mercenary.c
parent3c8999edce9e1f0d5c0dee3ff8311e781d64c684 (diff)
downloadhercules-95edabf40aaa4b14c46d5e085360998f54c4dc69.tar.gz
hercules-95edabf40aaa4b14c46d5e085360998f54c4dc69.tar.bz2
hercules-95edabf40aaa4b14c46d5e085360998f54c4dc69.tar.xz
hercules-95edabf40aaa4b14c46d5e085360998f54c4dc69.zip
- Updated svn-revision reading, now it can read the new svn file system
- Fixed a bug with homunc which could spawn on a non-walkable cell git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8500 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mercenary.c')
-rw-r--r--src/map/mercenary.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/map/mercenary.c b/src/map/mercenary.c
index 5ba260c18..4ff2c34b5 100644
--- a/src/map/mercenary.c
+++ b/src/map/mercenary.c
@@ -588,7 +588,8 @@ int search_homunculusDB_index(int key,int type)
int merc_hom_alloc(struct map_session_data *sd)
{
struct homun_data *hd;
- int i = 0 ;
+ int i = 0;
+ short x,y;
nullpo_retr(1, sd);
@@ -605,8 +606,16 @@ int merc_hom_alloc(struct map_session_data *sd)
hd->master = sd;
hd->bl.m = sd->bl.m;
+
+ // Find a random valid pos around the player
hd->bl.x = sd->bl.x;
- hd->bl.y = sd->bl.y - 1 ;
+ hd->bl.y = sd->bl.y;
+ x = sd->bl.x + 1;
+ y = sd->bl.y + 1;
+ map_random_dir(&hd->bl, &x, &y);
+ hd->bl.x = x;
+ hd->bl.y = y;
+
hd->bl.subtype = MONS;
hd->bl.type = BL_HOM;
hd->bl.id = npc_get_new_npc_id();