summaryrefslogtreecommitdiff
path: root/src/map/mercenary.c
diff options
context:
space:
mode:
authorzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-08-24 13:33:36 +0000
committerzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-08-24 13:33:36 +0000
commit8cb6244382cb6e1bb8b2edd13bba6b91f9c67b1f (patch)
tree8f7a613a82dbc47716983718bfaf8bbf2f69793c /src/map/mercenary.c
parent9ef83b403e59be7824e55e2526b5163bdf17f2b6 (diff)
downloadhercules-8cb6244382cb6e1bb8b2edd13bba6b91f9c67b1f.tar.gz
hercules-8cb6244382cb6e1bb8b2edd13bba6b91f9c67b1f.tar.bz2
hercules-8cb6244382cb6e1bb8b2edd13bba6b91f9c67b1f.tar.xz
hercules-8cb6244382cb6e1bb8b2edd13bba6b91f9c67b1f.zip
- Implemented unit_calc_pos (copy from pet_calc_pos) to implement it on Mercenary/Homunculus and don't use x,y-1 always.
- Implemented Mercenary walk to master (same packet as Homunculus). - Starting work on Stats but i will need lot of help. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13121 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mercenary.c')
-rw-r--r--src/map/mercenary.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/map/mercenary.c b/src/map/mercenary.c
index 16851d8f7..a127f7fad 100644
--- a/src/map/mercenary.c
+++ b/src/map/mercenary.c
@@ -120,8 +120,6 @@ int merc_data_received(struct s_mercenary *merc, bool flag)
if( !sd->md )
{
- short x = sd->bl.x, y = sd->bl.y;
-
sd->md = md = (struct mercenary_data*)aCalloc(1,sizeof(struct mercenary_data));
md->bl.type = BL_MER;
md->bl.id = npc_get_new_npc_id();
@@ -137,14 +135,12 @@ int merc_data_received(struct s_mercenary *merc, bool flag)
md->bl.m = sd->bl.m;
md->bl.x = sd->bl.x;
md->bl.y = sd->bl.y;
- x = sd->bl.x + 1;
- y = sd->bl.y + 1;
- map_random_dir(&md->bl, &x, &y);
- md->bl.x = x;
- md->bl.y = y;
+ unit_calc_pos(&md->bl, sd->bl.x, sd->bl.y, sd->ud.dir);
+ md->bl.x = md->ud.to_x;
+ md->bl.y = md->ud.to_y;
map_addiddb(&md->bl);
- // status_calc_mercenary(md,1);
+ status_calc_mercenary(md,1);
}
else
memcpy(&sd->md->mercenary, merc, sizeof(struct s_mercenary));
@@ -719,8 +715,6 @@ int merc_hom_alloc(struct map_session_data *sd, struct s_homunculus *hom)
{
struct homun_data *hd;
int i = 0;
- short x,y;
-
nullpo_retr(1, sd);
Assert((sd->status.hom_id == 0 || sd->hd == 0) || sd->hd->master == sd);
@@ -750,11 +744,9 @@ int merc_hom_alloc(struct map_session_data *sd, struct s_homunculus *hom)
hd->bl.m = sd->bl.m;
hd->bl.x = sd->bl.x;
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;
+ unit_calc_pos(&hd->bl, sd->bl.x, sd->bl.y, sd->ud.dir);
+ hd->bl.x = hd->ud.to_x;
+ hd->bl.y = hd->ud.to_y;
map_addiddb(&hd->bl);
status_calc_homunculus(hd,1);