summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authormomacabu <momacabu@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-11-28 00:22:59 +0000
committermomacabu <momacabu@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-11-28 00:22:59 +0000
commit4dc2b23bb31f7325c05b5515e03013a4c861aa59 (patch)
tree78a3ee74fb6b9f333d6dca542b82c67393a8658f /src/map
parent7a47bd731bc00b373c6105baad685bd8edeedbf6 (diff)
downloadhercules-4dc2b23bb31f7325c05b5515e03013a4c861aa59.tar.gz
hercules-4dc2b23bb31f7325c05b5515e03013a4c861aa59.tar.bz2
hercules-4dc2b23bb31f7325c05b5515e03013a4c861aa59.tar.xz
hercules-4dc2b23bb31f7325c05b5515e03013a4c861aa59.zip
- Fixed bugreport:6304, where mail titles could be bypassed thus having no length.
- Applied old patch by Daegaladh on bugreport:6044 for mercenaries and elementals mimic master's speed. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16974 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/clif.c6
-rw-r--r--src/map/pc.c20
2 files changed, 26 insertions, 0 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index a51163827..18a37d034 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -9135,6 +9135,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
clif_spawn(&sd->md->bl);
clif_mercenary_info(sd);
clif_mercenary_skillblock(sd);
+ status_calc_bl(&sd->md->bl, SCB_SPEED); //Mercenary mimic their master's speed on each map change
}
if (sd->ed) {
@@ -9144,6 +9145,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
clif_elemental_updatestatus(sd,SP_HP);
clif_hpmeter_single(sd->fd,sd->ed->bl.id,sd->ed->battle_status.hp,sd->ed->battle_status.matk_max);
clif_elemental_updatestatus(sd,SP_SP);
+ status_calc_bl(&sd->ed->bl, SCB_SPEED); //Elemental mimic their master's speed on each map change
}
if (sd->state.connect_new) {
@@ -13804,6 +13806,10 @@ void clif_parse_Mail_send(int fd, struct map_session_data *sd)
safestrncpy(msg.send_name, sd->status.name, NAME_LENGTH);
safestrncpy(msg.dest_name, (char *)RFIFOP(fd,4), NAME_LENGTH);
safestrncpy(msg.title, (char *)RFIFOP(fd,28), MAIL_TITLE_LENGTH);
+
+ if (msg.title[0] == '\0') {
+ return; // Message has no length and somehow client verification was skipped.
+ }
if (body_len)
safestrncpy(msg.body, (char *)RFIFOP(fd,69), body_len + 1);
diff --git a/src/map/pc.c b/src/map/pc.c
index 9f39b2747..83f1395a3 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -7266,6 +7266,19 @@ int pc_percentheal(struct map_session_data *sd,int hp,int sp)
return 0;
}
+static int jobchange_killclone(struct block_list *bl, va_list ap)
+{
+ struct mob_data *md;
+ int flag;
+ md = (struct mob_data *)bl;
+ nullpo_ret(md);
+ flag = va_arg(ap, int);
+
+ if (md->master_id && md->special_state.clone && md->master_id == flag)
+ status_kill(&md->bl);
+ return 1;
+}
+
/*==========================================
* Called when player changes job
* Rewrote to make it tidider [Celest]
@@ -7375,6 +7388,13 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
//Update skill tree.
pc_calc_skilltree(sd);
clif_skillinfoblock(sd);
+
+ if (sd->ed)
+ elemental_delete(sd->ed, 0);
+ if (sd->state.vending)
+ vending_closevending(sd);
+
+ map_foreachinmap(jobchange_killclone, sd->bl.m, BL_MOB, sd->bl.id);
//Remove peco/cart/falcon
i = sd->sc.option;