summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoramber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-05 03:46:19 +0000
committeramber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-05 03:46:19 +0000
commit2cd926a568df59089d202fd4bbf80a4100a8f891 (patch)
tree381ef2a667d6efba1217472fc52215c29a5f1f93
parentb26ca6871acc0ef2062668cfc9a0fcf7016e3ac1 (diff)
downloadhercules-2cd926a568df59089d202fd4bbf80a4100a8f891.tar.gz
hercules-2cd926a568df59089d202fd4bbf80a4100a8f891.tar.bz2
hercules-2cd926a568df59089d202fd4bbf80a4100a8f891.tar.xz
hercules-2cd926a568df59089d202fd4bbf80a4100a8f891.zip
More updates
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@447 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog.txt6
-rw-r--r--src/map/battle.c2
-rw-r--r--src/map/chrif.c11
-rw-r--r--src/map/chrif.h1
-rw-r--r--src/map/clif.c6
-rw-r--r--src/map/pc.c10
-rw-r--r--src/map/skill.c13
7 files changed, 40 insertions, 9 deletions
diff --git a/Changelog.txt b/Changelog.txt
index 9c7e10008..1919f715e 100644
--- a/Changelog.txt
+++ b/Changelog.txt
@@ -1,4 +1,10 @@
Date Added
+12/4
+ * Fixed a change associated with NPC_BARRIER [MouseJstr]
+ * Renamed flush_fifos_at_exit to flush_fifos [MouseJstr]
+ * call check_connect_char_server() on char_server disconnect [MouseJstr]
+ * stale skill groups were crashing server [MouseJstr]
+ * Fixed crash in SC_LULLABY [MouseJstr]
12/3
* hacked the frozen mob issue [MouseJstr]
* Fixed a battle_range crash [MouseJstr]
diff --git a/src/map/battle.c b/src/map/battle.c
index 6b1d68625..b6ef4146d 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -4964,7 +4964,7 @@ int battle_check_range(struct block_list *src,struct block_list *bl,int range)
// be lenient if the skill was cast before we have moved to the correct position [Celest]
if (src->type != BL_PC)
return 0;
- else if (src->type == BL_PC) {
+ else if (bl->type == BL_PC) {
struct map_session_data *sd;
nullpo_retr(0, (sd=(struct map_session_data *)bl));
if (sd->walktimer != -1 && !((arange-=battle_config.skill_range_leniency)<=range))
diff --git a/src/map/chrif.c b/src/map/chrif.c
index 479b328f5..d11604bc3 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -980,6 +980,17 @@ int chrif_parse(int fd)
if (fd == char_fd) {
printf("Map-server can't connect to char-server (connection #%d).\n", fd);
char_fd = -1;
+ check_connect_char_server(0, 0, 0, 0);
+ while (char_fd <= 0 || session[char_fd] == NULL) {
+ struct map_session_data *sd;
+ int idx;
+ for (idx = 0; idx <fd_max; idx++)
+ if ((session[idx] != NULL) && (sd = session[idx]->session_data) && sd && sd->state.auth)
+ clif_displaymessage(idx, "Map server is paused waiting for char server to return..");
+ flush_fifos();
+ sleep(10);
+ check_connect_char_server(0, 0, 0, 0);
+ }
}
close(fd);
delete_session(fd);
diff --git a/src/map/chrif.h b/src/map/chrif.h
index ab4f9580b..5f43120cc 100644
--- a/src/map/chrif.h
+++ b/src/map/chrif.h
@@ -27,6 +27,7 @@ int chrif_char_reset_offline(void);
int chrif_char_online(struct map_session_data *sd);
int chrif_changesex(int id, int sex);
int chrif_chardisconnect(struct map_session_data *sd);
+int check_connect_char_server(int tid, unsigned int tick, int id, int data);
int do_init_chrif(void);
diff --git a/src/map/clif.c b/src/map/clif.c
index 34ee7aaea..79ca0e227 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -4845,6 +4845,8 @@ int clif_refine(int fd,struct map_session_data *sd,int fail,int index,int val)
*/
int clif_wis_message(int fd, char *nick, char *mes, int mes_len) // R 0097 <len>.w <nick>.24B <message>.?B
{
+// printf("clif_wis_message(%d, %s, %s)\n", fd, nick, mes);
+
WFIFOW(fd,0) = 0x97;
WFIFOW(fd,2) = mes_len + 24 + 4;
memcpy(WFIFOP(fd,4), nick, 24);
@@ -5535,6 +5537,8 @@ int clif_party_created(struct map_session_data *sd,int flag)
{
int fd;
+ // printf("clif_party_message(%s, %d, %s)\n", p->name, account_id, mes);
+
nullpo_retr(0, sd);
fd=sd->fd;
@@ -6247,6 +6251,8 @@ int clif_guild_memberlogin_notice(struct guild *g,int idx,int flag)
nullpo_retr(0, g);
+ // printf("clif_guild_message(%s, %d, %s)\n", g->name, account_id, mes);
+
WBUFW(buf, 0)=0x16d;
WBUFL(buf, 2)=g->member[idx].account_id;
WBUFL(buf, 6)=g->member[idx].char_id;
diff --git a/src/map/pc.c b/src/map/pc.c
index f0e2a719f..0c8c32b9a 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -981,7 +981,9 @@ int pc_calc_skilltree_normalize_job(int c, struct map_session_data *sd) {
else if ((sd->status.skill_point >= sd->status.job_level && skill_point < sd->change_level+8) && (c > 6 && c < 23)) {
switch(c) {
case 7:
+ case 13:
case 14:
+ case 21:
c = 1;
break;
case 8:
@@ -1005,8 +1007,10 @@ int pc_calc_skilltree_normalize_job(int c, struct map_session_data *sd) {
case 17:
c = 6;
break;
- /*case 4008:
+ case 4008:
+ case 4014:
case 4015:
+ case 4022:
c = 4002;
break;
case 4009:
@@ -1031,7 +1035,9 @@ int pc_calc_skilltree_normalize_job(int c, struct map_session_data *sd) {
c = 4007;
break;
case 4030:
+ case 4036:
case 4037:
+ case 4044:
c = 4024;
break;
case 4031:
@@ -1054,7 +1060,7 @@ int pc_calc_skilltree_normalize_job(int c, struct map_session_data *sd) {
case 4035:
case 4043:
c = 4029;
- break;*/
+ break;
}
}
}
diff --git a/src/map/skill.c b/src/map/skill.c
index 8f711fd57..19e84d791 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -4264,9 +4264,9 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
int skill_time = skill_get_time(skillid,skilllv);
clif_skill_nodamage(src,bl,skillid,skilllv,1);
skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_time,0 );
- if (bl->type == BL_MOB)
+ if (src->type == BL_MOB)
mob_changestate((struct mob_data *)src,MS_DELAY,skill_time);
- else if (bl->type == BL_PC)
+ else if (src->type == BL_PC)
sd->attackabletime = sd->canmove_tick = tick + skill_time;
}
break;
@@ -6023,7 +6023,7 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int
if (sc_data[type].timer==-1)
skill_status_change_start(bl,type,sg->skill_lv,(int)src,0,0,skill_get_time2(sg->skill_id,sg->skill_lv),0);
else if((unit2=(struct skill_unit *)sc_data[type].val2) && unit2 != src ){
- if( DIFF_TICK(sg->tick,unit2->group->tick)>0 )
+ if( unit2->group != 0 && DIFF_TICK(sg->tick,unit2->group->tick)>0 )
skill_status_change_start(bl,type,sg->skill_lv,(int)src,0,0,skill_get_time2(sg->skill_id,sg->skill_lv),0);
ts->tick-=sg->interval;
}
@@ -6080,7 +6080,7 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int
skill_status_change_start(bl,type,sg->skill_lv,(sg->val1)>>16,(sg->val1)&0xffff,
(int)src,skill_get_time2(sg->skill_id,sg->skill_lv),0);
else if((unit2=(struct skill_unit *)sc_data[type].val4) && unit2 != src ){
- if( DIFF_TICK(sg->tick,unit2->group->tick)>0 )
+ if( unit2->group != 0 && DIFF_TICK(sg->tick,unit2->group->tick)>0 )
skill_status_change_start(bl,type,sg->skill_lv,(sg->val1)>>16,(sg->val1)&0xffff,
(int)src,skill_get_time2(sg->skill_id,sg->skill_lv),0);
ts->tick-=sg->interval;
@@ -8926,8 +8926,9 @@ int skill_status_change_timer(int tid, unsigned int tick, int id, int data)
if(!unit || !unit->group || unit->group->src_id==bl->id)
break;
skill_additional_effect(bl,bl,unit->group->skill_id,sc_data[type].val1,BF_LONG|BF_SKILL|BF_MISC,tick);
- sc_data[type].timer=add_timer(skill_get_time(unit->group->skill_id,unit->group->skill_lv)/10+tick,
- skill_status_change_timer, bl->id, data );
+ if (unit->group != 0)
+ sc_data[type].timer=add_timer(skill_get_time(unit->group->skill_id,unit->group->skill_lv)/10+tick,
+ skill_status_change_timer, bl->id, data );
return 0;
}
break;