diff options
author | (no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2004-11-05 00:00:50 +0000 |
---|---|---|
committer | (no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2004-11-05 00:00:50 +0000 |
commit | 33c37b2ba315af44f1ed17adafc06044059af32f (patch) | |
tree | d3e245143e1877e90a25763291e5ac08b5f7f5cd | |
parent | 8d77d2d60af57862d731814b23a81ec868668043 (diff) | |
download | hercules-33c37b2ba315af44f1ed17adafc06044059af32f.tar.gz hercules-33c37b2ba315af44f1ed17adafc06044059af32f.tar.bz2 hercules-33c37b2ba315af44f1ed17adafc06044059af32f.tar.xz hercules-33c37b2ba315af44f1ed17adafc06044059af32f.zip |
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/athena@9 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | src/map/chrif.c | 5 | ||||
-rw-r--r-- | src/map/clif.c | 6 | ||||
-rw-r--r-- | src/map/pc.c | 3 | ||||
-rw-r--r-- | src/map/skill.c | 24 |
4 files changed, 33 insertions, 5 deletions
diff --git a/src/map/chrif.c b/src/map/chrif.c index 0c456f128..0423d792b 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -885,7 +885,9 @@ int chrif_parse(int fd) // only char-server can have an access to here.
// so, if it isn't the char-server, we disconnect the session (fd != char_fd).
- if (fd != char_fd || session[fd]->eof) {
+ if(fd != char_fd)
+ session[fd]->eof = 1;
+ if(session[fd]->eof) {
if (fd == char_fd) {
printf("Map-server can't connect to char-server (connection #%d).\n", fd);
char_fd = -1;
@@ -905,6 +907,7 @@ int chrif_parse(int fd) if (r == 1) continue; // intifで処理した
if (r == 2) return 0; // intifで処理したが、データが足りない
+ close(fd); // intifで処理できなかった
session[fd]->eof = 1;
return 0;
}
diff --git a/src/map/clif.c b/src/map/clif.c index 99ccbb8c0..ecd165ac4 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -9476,9 +9476,13 @@ static int clif_parse(int fd) { sd = session[fd]->session_data;
// 接続が切れてるので後始末
- if (!chrif_isconnect() || session[fd]->eof) { // char鯖に繋がってない間は接続禁止 (!chrif_isconnect())
+ if (!chrif_isconnect())
+ session[fd]->eof = 1;
+ if(session[fd]->eof) { // char鯖に繋がってない間は接続禁止 (!chrif_isconnect())
if (sd && sd->state.auth) {
clif_quitsave(fd, sd);
+ if(sd->status.name!=NULL && battle_config.etc_log)
+ printf("Player [%s] Has Logged Off Your Server.\n",sd->status.name); // Player logout display [Valaris]
} else if (sd) { // not authentified! (refused by char-server or disconnect before to be authentified)
// printf("Player with account [%d] has logged off your server (not auth account).\n", sd->bl.id); // Player logout display [Yor]
map_deliddb(&sd->bl); // account_id has been included in the DB before auth answer
diff --git a/src/map/pc.c b/src/map/pc.c index 34a1e9c72..68fed3fb9 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -659,8 +659,7 @@ int pc_authok(int id, int login_id2, time_t connect_until_time, struct mmo_chars unsigned long tick = gettick();
sd = map_id2sd(id);
- if(sd==NULL)
- return 1;
+ nullpo_retr(1, sd);
sd->login_id2 = login_id2;
diff --git a/src/map/skill.c b/src/map/skill.c index de4ce3624..7d52a689c 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -909,7 +909,7 @@ int skill_additional_effect( struct block_list* src, struct block_list *bl,int s nullpo_retr(0, src);
nullpo_retr(0, bl);
- if(skilllv < 0) return 0;
+ if(skilllv <= 0) return 0;
if(src->type==BL_PC){
nullpo_retr(0, sd=(struct map_session_data *)src);
@@ -1370,6 +1370,9 @@ int skill_blown( struct block_list *src, struct block_list *target,int count) int skill_attack( int attack_type, struct block_list* src, struct block_list *dsrc,
struct block_list *bl,int skillid,int skilllv,unsigned int tick,int flag )
{
+
+ if(skilllv <= 0) return 0;
+
struct Damage dmg;
struct status_change *sc_data;
int type,lv,damage;
@@ -1835,6 +1838,7 @@ int skill_check_unit_range2(int m,int x,int y,int range) /* 対象の数をカウントする。(skill_area_temp[0]を初期化しておくこと) */
int skill_area_sub_count(struct block_list *src,struct block_list *target,int skillid,int skilllv,unsigned int tick,int flag)
{
+ if(skilllv <= 0) return 0;
if(skill_area_temp[0] < 0xffff)
skill_area_temp[0]++;
return 0;
@@ -2099,6 +2103,8 @@ int skill_cleartimerskill(struct block_list *src) */
int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int skillid,int skilllv,unsigned int tick,int flag )
{
+ if(skilllv <= 0) return 0;
+
struct map_session_data *sd=NULL;
int i;
@@ -2622,6 +2628,8 @@ int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int s */
int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int skillid,int skilllv,unsigned int tick,int flag )
{
+ if(skilllv <= 0) return 0;
+
struct map_session_data *sd=NULL;
struct map_session_data *dstsd=NULL;
struct mob_data *md=NULL;
@@ -4317,6 +4325,8 @@ int skill_castend_id( int tid, unsigned int tick, int id,int data ) */
int skill_castend_pos2( struct block_list *src, int x,int y,int skillid,int skilllv,unsigned int tick,int flag)
{
+ if(skilllv <= 0) return 0;
+
struct map_session_data *sd=NULL;
int i,tmpx = 0,tmpy = 0, x1 = 0, y1 = 0;
@@ -4574,6 +4584,7 @@ int skill_castend_map( struct map_session_data *sd,int skill_num, const char *ma }
}
+ if(sd->skilllv <= 0) return 0;
for(i=0;i<sd->skilllv;i++){
if(strcmp(map,p[i]->map)==0){
x=p[i]->x;
@@ -5884,6 +5895,7 @@ int skill_castend_pos( int tid, unsigned int tick, int id,int data ) }
}
+ if(sd->skilllv <= 0) return 0;
range = skill_get_range(sd->skillid,sd->skilllv);
if(range < 0)
range = battle_get_range(&sd->bl) - (range + 1);
@@ -6021,6 +6033,7 @@ static int skill_check_condition_use_sub(struct block_list *bl,va_list ap) ss_class = pc_calc_base_job(ssd->status.class);
skillid=ssd->skillid;
skilllv=ssd->skilllv;
+ if(skilllv <= 0) return 0;
switch(skillid){
case PR_BENEDICTIO: /* 聖体降福 */
if(sd != ssd && (sd->status.class == 4 || sd->status.class == 8 || sd->status.class == 15 ||
@@ -6145,6 +6158,7 @@ int skill_check_condition(struct map_session_data *sd,int type) }
skill = sd->skillid;
lv = sd->skilllv;
+ if(lv <= 0) return 0;
hp=skill_get_hp(skill, lv); /* 消費HP */
sp=skill_get_sp(skill, lv); /* 消費SP */
if((sd->skillid_old == BD_ENCORE) && skill==sd->skillid_dance)
@@ -6490,6 +6504,8 @@ int skill_castfix( struct block_list *bl, int time ) lv = sd->skilllv;
}
+ if(lv <= 0) return 0;
+
sc_data = battle_get_sc_data(bl);
dex=battle_get_dex(bl);
@@ -6899,6 +6915,7 @@ int skill_use_pos( struct map_session_data *sd, sd->skillid = skill_num;
sd->skilllv = skill_lv;
+ if(skill_lv <= 0) return 0;
sd->skillx = skill_x;
sd->skilly = skill_y;
if(!skill_check_condition(sd,0)) return 0;
@@ -7246,6 +7263,7 @@ int skill_autospell(struct map_session_data *sd,int skillid) nullpo_retr(0, sd);
skilllv = pc_checkskill(sd,SA_AUTOSPELL);
+ if(skilllv <= 0) return 0;
if(skillid==MG_NAPALMBEAT) maxlv=3;
else if(skillid==MG_COLDBOLT || skillid==MG_FIREBOLT || skillid==MG_LIGHTNINGBOLT){
@@ -7371,6 +7389,7 @@ int skill_frostjoke_scream(struct block_list *bl,va_list ap) skillnum=va_arg(ap,int);
skilllv=va_arg(ap,int);
+ if(skilllv <= 0) return 0;
tick=va_arg(ap,unsigned int);
if(src == bl)//自分には効かない
@@ -7392,6 +7411,7 @@ int skill_frostjoke_scream(struct block_list *bl,va_list ap) */
int skill_abra_dataset(int skilllv)
{
+ if(skilllv <= 0) return 0;
int skill = rand()%331;
//dbに基づくレベル・確率判定
if(skill_abra_db[skill].req_lv > skilllv || rand()%10000 >= skill_abra_db[skill].per) return 0;
@@ -7423,6 +7443,7 @@ int skill_attack_area(struct block_list *bl,va_list ap) return 0;
skillid=va_arg(ap,int);
skilllv=va_arg(ap,int);
+ if(skilllv <= 0) return 0;
tick=va_arg(ap,unsigned int);
flag=va_arg(ap,int);
type=va_arg(ap,int);
@@ -9294,6 +9315,7 @@ static int skill_unit_group_newid=10; struct skill_unit_group *skill_initunitgroup(struct block_list *src,
int count,int skillid,int skilllv,int unit_id)
{
+ if(skilllv <= 0) return 0;
int i;
struct skill_unit_group *group=NULL, *list=NULL;
int maxsug=0;
|