Removed battle_config.error_log as console_silent already handles this
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11751 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
90b75ed816
commit
560005b13e
@ -4,6 +4,7 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
|
|||||||
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
|
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
|
||||||
|
|
||||||
2007/11/17
|
2007/11/17
|
||||||
|
* Removed battle_config.error_log as console_silent already handles this
|
||||||
* Made OnTouch zone dimensions be stored as radius instead of diameter
|
* Made OnTouch zone dimensions be stored as radius instead of diameter
|
||||||
- cleaned up some overly complicated area calculations [ultramage]
|
- cleaned up some overly complicated area calculations [ultramage]
|
||||||
2007/11/16
|
2007/11/16
|
||||||
|
@ -55,7 +55,7 @@ pk_weapon_attack_damage_rate: 60
|
|||||||
pk_magic_attack_damage_rate: 60
|
pk_magic_attack_damage_rate: 60
|
||||||
pk_misc_attack_damage_rate: 60
|
pk_misc_attack_damage_rate: 60
|
||||||
|
|
||||||
// Display skill usage/errors in console? (for debug only) (default: off) (Note 3)
|
// Display skill usage in console? (for debug only) (default: off) (Note 3)
|
||||||
skill_log: off
|
skill_log: off
|
||||||
|
|
||||||
// Display battle log? (for debug only) (default: off) (Note 1)
|
// Display battle log? (for debug only) (default: off) (Note 1)
|
||||||
@ -64,9 +64,6 @@ battle_log: off
|
|||||||
// Display save log? (for debug only) (default: off) (Note 1)
|
// Display save log? (for debug only) (default: off) (Note 1)
|
||||||
save_log: off
|
save_log: off
|
||||||
|
|
||||||
// Display errors? (for debug only) (default: off) (Note 1)
|
|
||||||
error_log: on
|
|
||||||
|
|
||||||
// Display other stuff? (for debug only) (default: off) (Note 1)
|
// Display other stuff? (for debug only) (default: off) (Note 1)
|
||||||
etc_log: off
|
etc_log: off
|
||||||
|
|
||||||
|
@ -216,7 +216,6 @@ int battle_attr_fix(struct block_list *src, struct block_list *target, int damag
|
|||||||
|
|
||||||
if (def_type < 0 || def_type > ELE_MAX ||
|
if (def_type < 0 || def_type > ELE_MAX ||
|
||||||
def_lv < 1 || def_lv > 4) {
|
def_lv < 1 || def_lv > 4) {
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("battle_attr_fix: unknown attr type: atk=%d def_type=%d def_lv=%d\n",atk_elem,def_type,def_lv);
|
ShowError("battle_attr_fix: unknown attr type: atk=%d def_type=%d def_lv=%d\n",atk_elem,def_type,def_lv);
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
@ -1243,7 +1242,7 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
|
|||||||
if (nk&NK_SPLASHSPLIT){ // Divide ATK among targets
|
if (nk&NK_SPLASHSPLIT){ // Divide ATK among targets
|
||||||
if(wflag>0)
|
if(wflag>0)
|
||||||
wd.damage/= wflag;
|
wd.damage/= wflag;
|
||||||
else if(battle_config.error_log)
|
else
|
||||||
ShowError("0 enemies targeted by %d:%s, divide per 0 avoided!\n", skill_num, skill_get_name(skill_num));
|
ShowError("0 enemies targeted by %d:%s, divide per 0 avoided!\n", skill_num, skill_get_name(skill_num));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2220,7 +2219,7 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
|
|||||||
if(nk&NK_SPLASHSPLIT){ // Divide MATK in case of multiple targets skill
|
if(nk&NK_SPLASHSPLIT){ // Divide MATK in case of multiple targets skill
|
||||||
if(mflag>0)
|
if(mflag>0)
|
||||||
ad.damage/= mflag;
|
ad.damage/= mflag;
|
||||||
else if(battle_config.error_log)
|
else
|
||||||
ShowError("0 enemies targeted by %d:%s, divide per 0 avoided!\n", skill_num, skill_get_name(skill_num));
|
ShowError("0 enemies targeted by %d:%s, divide per 0 avoided!\n", skill_num, skill_get_name(skill_num));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2563,7 +2562,7 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
|
|||||||
if (nk&NK_SPLASHSPLIT){ // Divide ATK among targets
|
if (nk&NK_SPLASHSPLIT){ // Divide ATK among targets
|
||||||
if(mflag>0)
|
if(mflag>0)
|
||||||
md.damage/= mflag;
|
md.damage/= mflag;
|
||||||
else if(battle_config.error_log)
|
else
|
||||||
ShowError("0 enemies targeted by %d:%s, divide per 0 avoided!\n", skill_num, skill_get_name(skill_num));
|
ShowError("0 enemies targeted by %d:%s, divide per 0 avoided!\n", skill_num, skill_get_name(skill_num));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2661,7 +2660,6 @@ struct Damage battle_calc_attack(int attack_type,struct block_list *bl,struct bl
|
|||||||
case BF_MAGIC: d = battle_calc_magic_attack(bl,target,skill_num,skill_lv,count); break;
|
case BF_MAGIC: d = battle_calc_magic_attack(bl,target,skill_num,skill_lv,count); break;
|
||||||
case BF_MISC: d = battle_calc_misc_attack(bl,target,skill_num,skill_lv,count); break;
|
case BF_MISC: d = battle_calc_misc_attack(bl,target,skill_num,skill_lv,count); break;
|
||||||
default:
|
default:
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("battle_calc_attack: unknown attack type! %d\n",attack_type);
|
ShowError("battle_calc_attack: unknown attack type! %d\n",attack_type);
|
||||||
memset(&d,0,sizeof(d));
|
memset(&d,0,sizeof(d));
|
||||||
break;
|
break;
|
||||||
@ -3462,7 +3460,6 @@ static const struct _battle_data {
|
|||||||
{ "skill_log", &battle_config.skill_log, BL_NUL, BL_NUL, BL_ALL, },
|
{ "skill_log", &battle_config.skill_log, BL_NUL, BL_NUL, BL_ALL, },
|
||||||
{ "battle_log", &battle_config.battle_log, 0, 0, 1, },
|
{ "battle_log", &battle_config.battle_log, 0, 0, 1, },
|
||||||
{ "save_log", &battle_config.save_log, 0, 0, 1, },
|
{ "save_log", &battle_config.save_log, 0, 0, 1, },
|
||||||
{ "error_log", &battle_config.error_log, 1, 0, 1, },
|
|
||||||
{ "etc_log", &battle_config.etc_log, 1, 0, 1, },
|
{ "etc_log", &battle_config.etc_log, 1, 0, 1, },
|
||||||
{ "save_clothcolor", &battle_config.save_clothcolor, 1, 0, 1, },
|
{ "save_clothcolor", &battle_config.save_clothcolor, 1, 0, 1, },
|
||||||
{ "undead_detect_type", &battle_config.undead_detect_type, 0, 0, 2, },
|
{ "undead_detect_type", &battle_config.undead_detect_type, 0, 0, 2, },
|
||||||
|
@ -223,7 +223,6 @@ extern struct Battle_Config
|
|||||||
int skill_log;
|
int skill_log;
|
||||||
int battle_log;
|
int battle_log;
|
||||||
int save_log;
|
int save_log;
|
||||||
int error_log;
|
|
||||||
int etc_log;
|
int etc_log;
|
||||||
int save_clothcolor;
|
int save_clothcolor;
|
||||||
int undead_detect_type;
|
int undead_detect_type;
|
||||||
|
@ -324,7 +324,6 @@ int chrif_changemapserverack(int account_id, int login_id1, int login_id2, int c
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (login_id1 == 1) { //FIXME: charserver says '0'! [ultramage]
|
if (login_id1 == 1) { //FIXME: charserver says '0'! [ultramage]
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("map server change failed.\n");
|
ShowError("map server change failed.\n");
|
||||||
clif_authfail_fd(sd->fd, 0);
|
clif_authfail_fd(sd->fd, 0);
|
||||||
return 0;
|
return 0;
|
||||||
@ -1321,7 +1320,6 @@ int chrif_parse(int fd)
|
|||||||
case 0x2b22: chrif_updatefamelist_ack(fd); break;
|
case 0x2b22: chrif_updatefamelist_ack(fd); break;
|
||||||
case 0x2b24: chrif_keepalive_ack(fd); break;
|
case 0x2b24: chrif_keepalive_ack(fd); break;
|
||||||
default:
|
default:
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("chrif_parse : unknown packet (session #%d): 0x%x. Disconnecting.\n", fd, cmd);
|
ShowError("chrif_parse : unknown packet (session #%d): 0x%x. Disconnecting.\n", fd, cmd);
|
||||||
set_eof(fd);
|
set_eof(fd);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -497,7 +497,6 @@ int clif_send(const uint8* buf, int len, struct block_list* bl, enum send_target
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("clif_send: Unrecognized type %d\n",type);
|
ShowError("clif_send: Unrecognized type %d\n",type);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -2593,7 +2592,6 @@ int clif_updatestatus(struct map_session_data *sd,int type)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("clif_updatestatus : unrecognized type %d\n",type);
|
ShowError("clif_updatestatus : unrecognized type %d\n",type);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -2621,7 +2619,6 @@ int clif_changestatus(struct block_list *bl,int type,int val)
|
|||||||
WBUFL(buf,8)=val;
|
WBUFL(buf,8)=val;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("clif_changestatus : unrecognized type %d.\n",type);
|
ShowError("clif_changestatus : unrecognized type %d.\n",type);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -7399,7 +7396,6 @@ int clif_charnameack (int fd, struct block_list *bl)
|
|||||||
// break;
|
// break;
|
||||||
return 0;
|
return 0;
|
||||||
default:
|
default:
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("clif_parse_GetCharNameRequest : bad type %d(%d)\n", bl->type, bl->id);
|
ShowError("clif_parse_GetCharNameRequest : bad type %d(%d)\n", bl->type, bl->id);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -7498,7 +7494,6 @@ int clif_disp_overhead(struct map_session_data *sd, const char* mes)
|
|||||||
int len_mes = strlen(mes)+1; //Account for \0
|
int len_mes = strlen(mes)+1; //Account for \0
|
||||||
|
|
||||||
if (len_mes + 8 >= 256) {
|
if (len_mes + 8 >= 256) {
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("clif_disp_overhead: Message too long (length %d)\n", len_mes);
|
ShowError("clif_disp_overhead: Message too long (length %d)\n", len_mes);
|
||||||
len_mes = 247; //Trunk it to avoid problems.
|
len_mes = 247; //Trunk it to avoid problems.
|
||||||
}
|
}
|
||||||
@ -7810,7 +7805,6 @@ void clif_parse_WantToConnection(int fd, TBL_PC* sd)
|
|||||||
int packet_ver; // 5: old, 6: 7july04, 7: 13july04, 8: 26july04, 9: 9aug04/16aug04/17aug04, 10: 6sept04, 11: 21sept04, 12: 18oct04, 13: 25oct04 (by [Yor])
|
int packet_ver; // 5: old, 6: 7july04, 7: 13july04, 8: 26july04, 9: 9aug04/16aug04/17aug04, 10: 6sept04, 11: 21sept04, 12: 18oct04, 13: 25oct04 (by [Yor])
|
||||||
|
|
||||||
if (sd) {
|
if (sd) {
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("clif_parse_WantToConnection : invalid request (character already logged in)?\n");
|
ShowError("clif_parse_WantToConnection : invalid request (character already logged in)?\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -10091,7 +10085,6 @@ void clif_parse_GuildRequestInfo(int fd, struct map_session_data *sd)
|
|||||||
clif_guild_expulsionlist(sd);
|
clif_guild_expulsionlist(sd);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("clif: guild request info: unknown type %d\n", RFIFOL(fd,2));
|
ShowError("clif: guild request info: unknown type %d\n", RFIFOL(fd,2));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -511,7 +511,6 @@ int guild_check_member(struct guild *g)
|
|||||||
sd->status.guild_id=0;
|
sd->status.guild_id=0;
|
||||||
sd->state.guild_sent=0;
|
sd->state.guild_sent=0;
|
||||||
sd->guild_emblem_id=0;
|
sd->guild_emblem_id=0;
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowWarning("guild: check_member %d[%s] is not member\n",sd->status.account_id,sd->status.name);
|
ShowWarning("guild: check_member %d[%s] is not member\n",sd->status.account_id,sd->status.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -568,7 +567,6 @@ int guild_recv_info(struct guild *sg)
|
|||||||
|
|
||||||
if(g->max_member > MAX_GUILD)
|
if(g->max_member > MAX_GUILD)
|
||||||
{
|
{
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("guild_recv_info: Received guild with %d members, but MAX_GUILD is only %d. Extra guild-members have been lost!\n", g->max_member, MAX_GUILD);
|
ShowError("guild_recv_info: Received guild with %d members, but MAX_GUILD is only %d. Extra guild-members have been lost!\n", g->max_member, MAX_GUILD);
|
||||||
g->max_member = MAX_GUILD;
|
g->max_member = MAX_GUILD;
|
||||||
}
|
}
|
||||||
@ -748,7 +746,6 @@ int guild_member_added(int guild_id,int account_id,int char_id,int flag)
|
|||||||
if(sd==NULL || sd->guild_invite==0){
|
if(sd==NULL || sd->guild_invite==0){
|
||||||
// キャラ側に登録できなかったため脱退要求を出す
|
// キャラ側に登録できなかったため脱退要求を出す
|
||||||
if (flag == 0) {
|
if (flag == 0) {
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("guild: member added error %d is not online\n",account_id);
|
ShowError("guild: member added error %d is not online\n",account_id);
|
||||||
intif_guild_leave(guild_id,account_id,char_id,0,"**登録失敗**");
|
intif_guild_leave(guild_id,account_id,char_id,0,"**登録失敗**");
|
||||||
}
|
}
|
||||||
@ -959,7 +956,6 @@ int guild_recv_memberinfoshort(int guild_id,int account_id,int char_id,int onlin
|
|||||||
sd->guild_emblem_id=0;
|
sd->guild_emblem_id=0;
|
||||||
sd->state.guild_sent=0;
|
sd->state.guild_sent=0;
|
||||||
}
|
}
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowWarning("guild: not found member %d,%d on %d[%s]\n", account_id,char_id,guild_id,g->name);
|
ShowWarning("guild: not found member %d,%d on %d[%s]\n", account_id,char_id,guild_id,g->name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -282,7 +282,6 @@ int intif_saveregistry(struct map_session_data *sd, int type)
|
|||||||
sd->state.reg_dirty &= ~0x1;
|
sd->state.reg_dirty &= ~0x1;
|
||||||
break;
|
break;
|
||||||
default: //Broken code?
|
default: //Broken code?
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("intif_saveregistry: Invalid type %d\n", type);
|
ShowError("intif_saveregistry: Invalid type %d\n", type);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -962,7 +961,6 @@ int intif_parse_Registers(int fd)
|
|||||||
max = ACCOUNT_REG2_NUM;
|
max = ACCOUNT_REG2_NUM;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("intif_parse_Registers: Unrecognized type %d\n",RFIFOB(fd,12));
|
ShowError("intif_parse_Registers: Unrecognized type %d\n",RFIFOB(fd,12));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -989,7 +987,6 @@ int intif_parse_LoadStorage(int fd)
|
|||||||
|
|
||||||
sd=map_id2sd( RFIFOL(fd,4) );
|
sd=map_id2sd( RFIFOL(fd,4) );
|
||||||
if(sd==NULL){
|
if(sd==NULL){
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("intif_parse_LoadStorage: user not found %d\n",RFIFOL(fd,4));
|
ShowError("intif_parse_LoadStorage: user not found %d\n",RFIFOL(fd,4));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -1000,17 +997,14 @@ int intif_parse_LoadStorage(int fd)
|
|||||||
stor = account2storage( RFIFOL(fd,4));
|
stor = account2storage( RFIFOL(fd,4));
|
||||||
|
|
||||||
if (stor->storage_status == 1) { // Already open.. lets ignore this update
|
if (stor->storage_status == 1) { // Already open.. lets ignore this update
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowWarning("intif_parse_LoadStorage: storage received for a client already open (User %d:%d)\n", sd->status.account_id, sd->status.char_id);
|
ShowWarning("intif_parse_LoadStorage: storage received for a client already open (User %d:%d)\n", sd->status.account_id, sd->status.char_id);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (stor->dirty) { // Already have storage, and it has been modified and not saved yet! Exploit! [Skotlex]
|
if (stor->dirty) { // Already have storage, and it has been modified and not saved yet! Exploit! [Skotlex]
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowWarning("intif_parse_LoadStorage: received storage for an already modified non-saved storage! (User %d:%d)\n", sd->status.account_id, sd->status.char_id);
|
ShowWarning("intif_parse_LoadStorage: received storage for an already modified non-saved storage! (User %d:%d)\n", sd->status.account_id, sd->status.char_id);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (RFIFOW(fd,2)-8 != sizeof(struct storage)) {
|
if (RFIFOW(fd,2)-8 != sizeof(struct storage)) {
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("intif_parse_LoadStorage: data size error %d %d\n", RFIFOW(fd,2)-8, sizeof(struct storage));
|
ShowError("intif_parse_LoadStorage: data size error %d %d\n", RFIFOW(fd,2)-8, sizeof(struct storage));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -1046,30 +1040,24 @@ int intif_parse_LoadGuildStorage(int fd)
|
|||||||
return 1;
|
return 1;
|
||||||
sd=map_id2sd( RFIFOL(fd,4) );
|
sd=map_id2sd( RFIFOL(fd,4) );
|
||||||
if(sd==NULL){
|
if(sd==NULL){
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("intif_parse_LoadGuildStorage: user not found %d\n",RFIFOL(fd,4));
|
ShowError("intif_parse_LoadGuildStorage: user not found %d\n",RFIFOL(fd,4));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
gstor=guild2storage(guild_id);
|
gstor=guild2storage(guild_id);
|
||||||
if(!gstor) {
|
if(!gstor) {
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowWarning("intif_parse_LoadGuildStorage: error guild_id %d not exist\n",guild_id);
|
ShowWarning("intif_parse_LoadGuildStorage: error guild_id %d not exist\n",guild_id);
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
if (gstor->storage_status == 1) { // Already open.. lets ignore this update
|
if (gstor->storage_status == 1) { // Already open.. lets ignore this update
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowWarning("intif_parse_LoadGuildStorage: storage received for a client already open (User %d:%d)\n", sd->status.account_id, sd->status.char_id);
|
ShowWarning("intif_parse_LoadGuildStorage: storage received for a client already open (User %d:%d)\n", sd->status.account_id, sd->status.char_id);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (gstor->dirty) { // Already have storage, and it has been modified and not saved yet! Exploit! [Skotlex]
|
if (gstor->dirty) { // Already have storage, and it has been modified and not saved yet! Exploit! [Skotlex]
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowWarning("intif_parse_LoadGuildStorage: received storage for an already modified non-saved storage! (User %d:%d)\n", sd->status.account_id, sd->status.char_id);
|
ShowWarning("intif_parse_LoadGuildStorage: received storage for an already modified non-saved storage! (User %d:%d)\n", sd->status.account_id, sd->status.char_id);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if( RFIFOW(fd,2)-12 != sizeof(struct guild_storage) ){
|
if( RFIFOW(fd,2)-12 != sizeof(struct guild_storage) ){
|
||||||
gstor->storage_status = 0;
|
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("intif_parse_LoadGuildStorage: data size error %d %d\n",RFIFOW(fd,2)-12 , sizeof(struct guild_storage));
|
ShowError("intif_parse_LoadGuildStorage: data size error %d %d\n",RFIFOW(fd,2)-12 , sizeof(struct guild_storage));
|
||||||
|
gstor->storage_status = 0;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if(battle_config.save_log)
|
if(battle_config.save_log)
|
||||||
@ -1102,17 +1090,14 @@ int intif_parse_PartyCreated(int fd)
|
|||||||
int intif_parse_PartyInfo(int fd)
|
int intif_parse_PartyInfo(int fd)
|
||||||
{
|
{
|
||||||
if( RFIFOW(fd,2)==8){
|
if( RFIFOW(fd,2)==8){
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowWarning("intif: party noinfo %d\n",RFIFOL(fd,4));
|
ShowWarning("intif: party noinfo %d\n",RFIFOL(fd,4));
|
||||||
party_recv_noinfo(RFIFOL(fd,4));
|
party_recv_noinfo(RFIFOL(fd,4));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// printf("intif: party info %d\n",RFIFOL(fd,4));
|
// printf("intif: party info %d\n",RFIFOL(fd,4));
|
||||||
if( RFIFOW(fd,2)!=sizeof(struct party)+4 ){
|
if( RFIFOW(fd,2)!=sizeof(struct party)+4 )
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("intif: party info : data size error %d %d %d\n",RFIFOL(fd,4),RFIFOW(fd,2),sizeof(struct party)+4);
|
ShowError("intif: party info : data size error %d %d %d\n",RFIFOL(fd,4),RFIFOW(fd,2),sizeof(struct party)+4);
|
||||||
}
|
|
||||||
party_recv_info((struct party *)RFIFOP(fd,4));
|
party_recv_info((struct party *)RFIFOP(fd,4));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1167,18 +1152,13 @@ int intif_parse_GuildCreated(int fd)
|
|||||||
int intif_parse_GuildInfo(int fd)
|
int intif_parse_GuildInfo(int fd)
|
||||||
{
|
{
|
||||||
if(RFIFOW(fd,2) == 8) {
|
if(RFIFOW(fd,2) == 8) {
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowWarning("intif: guild noinfo %d\n",RFIFOL(fd,4));
|
ShowWarning("intif: guild noinfo %d\n",RFIFOL(fd,4));
|
||||||
guild_recv_noinfo(RFIFOL(fd,4));
|
guild_recv_noinfo(RFIFOL(fd,4));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if(battle_config.etc_log)
|
if( RFIFOW(fd,2)!=sizeof(struct guild)+4 )
|
||||||
// printf("intif: guild info %d\n",RFIFOL(fd,4));
|
|
||||||
if( RFIFOW(fd,2)!=sizeof(struct guild)+4 ){
|
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("intif: guild info : data size error Gid: %d recv size: %d Expected size: %d\n",RFIFOL(fd,4),RFIFOW(fd,2),sizeof(struct guild)+4);
|
ShowError("intif: guild info : data size error Gid: %d recv size: %d Expected size: %d\n",RFIFOL(fd,4),RFIFOW(fd,2),sizeof(struct guild)+4);
|
||||||
}
|
|
||||||
guild_recv_info((struct guild *)RFIFOP(fd,4));
|
guild_recv_info((struct guild *)RFIFOP(fd,4));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1270,10 +1250,8 @@ int intif_parse_GuildMemberInfoChanged(int fd)
|
|||||||
// ƒMƒ‹ƒh–ð<E28093>E•Ï<E280A2>X’Ê’m
|
// ƒMƒ‹ƒh–ð<E28093>E•Ï<E280A2>X’Ê’m
|
||||||
int intif_parse_GuildPosition(int fd)
|
int intif_parse_GuildPosition(int fd)
|
||||||
{
|
{
|
||||||
if( RFIFOW(fd,2)!=sizeof(struct guild_position)+12 ){
|
if( RFIFOW(fd,2)!=sizeof(struct guild_position)+12 )
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("intif: guild info : data size error\n %d %d %d",RFIFOL(fd,4),RFIFOW(fd,2),sizeof(struct guild_position)+12);
|
ShowError("intif: guild info : data size error\n %d %d %d",RFIFOL(fd,4),RFIFOW(fd,2),sizeof(struct guild_position)+12);
|
||||||
}
|
|
||||||
guild_position_changed(RFIFOL(fd,4),RFIFOL(fd,8),(struct guild_position *)RFIFOP(fd,12));
|
guild_position_changed(RFIFOL(fd,4),RFIFOL(fd,8),(struct guild_position *)RFIFOP(fd,12));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1354,20 +1332,16 @@ int intif_parse_RecvPetData(int fd)
|
|||||||
}
|
}
|
||||||
int intif_parse_SavePetOk(int fd)
|
int intif_parse_SavePetOk(int fd)
|
||||||
{
|
{
|
||||||
if(RFIFOB(fd,6) == 1) {
|
if(RFIFOB(fd,6) == 1)
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("pet data save failure\n");
|
ShowError("pet data save failure\n");
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int intif_parse_DeletePetOk(int fd)
|
int intif_parse_DeletePetOk(int fd)
|
||||||
{
|
{
|
||||||
if(RFIFOB(fd,2) == 1) {
|
if(RFIFOB(fd,2) == 1)
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("pet data delete failure\n");
|
ShowError("pet data delete failure\n");
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1425,19 +1399,16 @@ int intif_parse_RecvHomunculusData(int fd)
|
|||||||
|
|
||||||
int intif_parse_SaveHomunculusOk(int fd)
|
int intif_parse_SaveHomunculusOk(int fd)
|
||||||
{
|
{
|
||||||
if(RFIFOB(fd,6) != 1) {
|
if(RFIFOB(fd,6) != 1)
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("homunculus data save failure for account %d\n", RFIFOL(fd,2));
|
ShowError("homunculus data save failure for account %d\n", RFIFOL(fd,2));
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int intif_parse_DeleteHomunculusOk(int fd)
|
int intif_parse_DeleteHomunculusOk(int fd)
|
||||||
{
|
{
|
||||||
if(RFIFOB(fd,2) != 1) {
|
if(RFIFOB(fd,2) != 1)
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("Homunculus data delete failure\n");
|
ShowError("Homunculus data delete failure\n");
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1475,7 +1446,6 @@ int intif_parse_Mail_inboxreceived(int fd)
|
|||||||
|
|
||||||
if (sd == NULL)
|
if (sd == NULL)
|
||||||
{
|
{
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("intif_parse_Mail_inboxreceived: char not found %d\n",RFIFOL(fd,4));
|
ShowError("intif_parse_Mail_inboxreceived: char not found %d\n",RFIFOL(fd,4));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -1485,7 +1455,6 @@ int intif_parse_Mail_inboxreceived(int fd)
|
|||||||
|
|
||||||
if (RFIFOW(fd,2) - 9 != sizeof(struct mail_data))
|
if (RFIFOW(fd,2) - 9 != sizeof(struct mail_data))
|
||||||
{
|
{
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("intif_parse_Mail_inboxreceived: data size error %d %d\n", RFIFOW(fd,2) - 9, sizeof(struct mail_data));
|
ShowError("intif_parse_Mail_inboxreceived: data size error %d %d\n", RFIFOW(fd,2) - 9, sizeof(struct mail_data));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -1545,7 +1514,6 @@ int intif_parse_Mail_getattach(int fd)
|
|||||||
|
|
||||||
if (sd == NULL)
|
if (sd == NULL)
|
||||||
{
|
{
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("intif_parse_Mail_getattach: char not found %d\n",RFIFOL(fd,4));
|
ShowError("intif_parse_Mail_getattach: char not found %d\n",RFIFOL(fd,4));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -1555,7 +1523,6 @@ int intif_parse_Mail_getattach(int fd)
|
|||||||
|
|
||||||
if (RFIFOW(fd,2) - 12 != sizeof(struct item))
|
if (RFIFOW(fd,2) - 12 != sizeof(struct item))
|
||||||
{
|
{
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("intif_parse_Mail_getattach: data size error %d %d\n", RFIFOW(fd,2) - 16, sizeof(struct item));
|
ShowError("intif_parse_Mail_getattach: data size error %d %d\n", RFIFOW(fd,2) - 16, sizeof(struct item));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -1591,7 +1558,6 @@ int intif_parse_Mail_delete(int fd)
|
|||||||
struct map_session_data *sd = map_charid2sd(char_id);
|
struct map_session_data *sd = map_charid2sd(char_id);
|
||||||
if (sd == NULL)
|
if (sd == NULL)
|
||||||
{
|
{
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("intif_parse_Mail_delete: char not found %d\n", char_id);
|
ShowError("intif_parse_Mail_delete: char not found %d\n", char_id);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -1641,7 +1607,6 @@ int intif_parse_Mail_return(int fd)
|
|||||||
|
|
||||||
if( sd == NULL )
|
if( sd == NULL )
|
||||||
{
|
{
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("intif_parse_Mail_return: char not found %d\n",RFIFOL(fd,2));
|
ShowError("intif_parse_Mail_return: char not found %d\n",RFIFOL(fd,2));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -1691,7 +1656,6 @@ static void intif_parse_Mail_send(int fd)
|
|||||||
|
|
||||||
if( RFIFOW(fd,2) - 4 != sizeof(struct mail_message) )
|
if( RFIFOW(fd,2) - 4 != sizeof(struct mail_message) )
|
||||||
{
|
{
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("intif_parse_Mail_send: data size error %d %d\n", RFIFOW(fd,2) - 4, sizeof(struct mail_message));
|
ShowError("intif_parse_Mail_send: data size error %d %d\n", RFIFOW(fd,2) - 4, sizeof(struct mail_message));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1829,7 +1793,6 @@ int intif_parse(int fd)
|
|||||||
case 0x3892: intif_parse_SaveHomunculusOk(fd); break;
|
case 0x3892: intif_parse_SaveHomunculusOk(fd); break;
|
||||||
case 0x3893: intif_parse_DeleteHomunculusOk(fd); break;
|
case 0x3893: intif_parse_DeleteHomunculusOk(fd); break;
|
||||||
default:
|
default:
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("intif_parse : unknown packet %d %x\n",fd,RFIFOW(fd,0));
|
ShowError("intif_parse : unknown packet %d %x\n",fd,RFIFOW(fd,0));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -142,14 +142,12 @@ int itemdb_searchname_array(struct item_data** data, int size, const char *str)
|
|||||||
int itemdb_searchrandomid(int group)
|
int itemdb_searchrandomid(int group)
|
||||||
{
|
{
|
||||||
if(group<1 || group>=MAX_ITEMGROUP) {
|
if(group<1 || group>=MAX_ITEMGROUP) {
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("itemdb_searchrandomid: Invalid group id %d\n", group);
|
ShowError("itemdb_searchrandomid: Invalid group id %d\n", group);
|
||||||
return UNKNOWN_ITEM_ID;
|
return UNKNOWN_ITEM_ID;
|
||||||
}
|
}
|
||||||
if (itemgroup_db[group].qty)
|
if (itemgroup_db[group].qty)
|
||||||
return itemgroup_db[group].nameid[rand()%itemgroup_db[group].qty];
|
return itemgroup_db[group].nameid[rand()%itemgroup_db[group].qty];
|
||||||
|
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("itemdb_searchrandomid: No item entries for group id %d\n", group);
|
ShowError("itemdb_searchrandomid: No item entries for group id %d\n", group);
|
||||||
return UNKNOWN_ITEM_ID;
|
return UNKNOWN_ITEM_ID;
|
||||||
}
|
}
|
||||||
@ -302,7 +300,6 @@ struct item_data* itemdb_load(int nameid)
|
|||||||
|
|
||||||
static void* return_dummy_data(DBKey key, va_list args)
|
static void* return_dummy_data(DBKey key, va_list args)
|
||||||
{
|
{
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowWarning("itemdb_search: Item ID %d does not exists in the item_db. Using dummy data.\n", key.i);
|
ShowWarning("itemdb_search: Item ID %d does not exists in the item_db. Using dummy data.\n", key.i);
|
||||||
dummy_item.nameid = key.i;
|
dummy_item.nameid = key.i;
|
||||||
return &dummy_item;
|
return &dummy_item;
|
||||||
|
@ -233,9 +233,7 @@ int map_freeblock (struct block_list *bl)
|
|||||||
aFree(bl);
|
aFree(bl);
|
||||||
bl = NULL;
|
bl = NULL;
|
||||||
if (block_free_count >= block_free_max)
|
if (block_free_count >= block_free_max)
|
||||||
if (battle_config.error_log)
|
ShowWarning("map_freeblock: too many free block! %d %d\n", block_free_count, block_free_lock);
|
||||||
ShowWarning("map_freeblock: too many free block! %d %d\n",
|
|
||||||
block_free_count, block_free_lock);
|
|
||||||
} else
|
} else
|
||||||
block_free[block_free_count++] = bl;
|
block_free[block_free_count++] = bl;
|
||||||
|
|
||||||
@ -265,7 +263,6 @@ int map_freeblock_unlock (void)
|
|||||||
}
|
}
|
||||||
block_free_count = 0;
|
block_free_count = 0;
|
||||||
} else if (block_free_lock < 0) {
|
} else if (block_free_lock < 0) {
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("map_freeblock_unlock: lock count < 0 !\n");
|
ShowError("map_freeblock_unlock: lock count < 0 !\n");
|
||||||
block_free_lock = 0;
|
block_free_lock = 0;
|
||||||
}
|
}
|
||||||
@ -332,7 +329,6 @@ int map_addblock_sub (struct block_list *bl, int flag)
|
|||||||
nullpo_retr(0, bl);
|
nullpo_retr(0, bl);
|
||||||
|
|
||||||
if (bl->prev != NULL) {
|
if (bl->prev != NULL) {
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("map_addblock: bl->prev != NULL\n");
|
ShowError("map_addblock: bl->prev != NULL\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -399,7 +395,6 @@ int map_delblock_sub (struct block_list *bl, int flag)
|
|||||||
if (bl->prev == NULL) {
|
if (bl->prev == NULL) {
|
||||||
if (bl->next != NULL) {
|
if (bl->next != NULL) {
|
||||||
// prevがNULLでnextがNULLでないのは有ってはならない
|
// prevがNULLでnextがNULLでないのは有ってはならない
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("map_delblock error : bl->next!=NULL\n");
|
ShowError("map_delblock error : bl->next!=NULL\n");
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -646,10 +641,8 @@ int map_foreachinrange(int (*func)(struct block_list*,va_list), struct block_lis
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(bl_list_count>=BL_LIST_MAX) {
|
if(bl_list_count>=BL_LIST_MAX)
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowWarning("map_foreachinrange: block count too many!\n");
|
ShowWarning("map_foreachinrange: block count too many!\n");
|
||||||
}
|
|
||||||
|
|
||||||
map_freeblock_lock(); // メモリからの解放を禁止する
|
map_freeblock_lock(); // メモリからの解放を禁止する
|
||||||
|
|
||||||
@ -720,10 +713,8 @@ int map_foreachinshootrange(int (*func)(struct block_list*,va_list),struct block
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(bl_list_count>=BL_LIST_MAX) {
|
if(bl_list_count>=BL_LIST_MAX)
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowWarning("map_foreachinrange: block count too many!\n");
|
ShowWarning("map_foreachinrange: block count too many!\n");
|
||||||
}
|
|
||||||
|
|
||||||
map_freeblock_lock(); // メモリからの解放を禁止する
|
map_freeblock_lock(); // メモリからの解放を禁止する
|
||||||
|
|
||||||
@ -794,10 +785,8 @@ int map_foreachinarea(int (*func)(struct block_list*,va_list), int m, int x0, in
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(bl_list_count>=BL_LIST_MAX) {
|
if(bl_list_count>=BL_LIST_MAX)
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowWarning("map_foreachinarea: block count too many!\n");
|
ShowWarning("map_foreachinarea: block count too many!\n");
|
||||||
}
|
|
||||||
|
|
||||||
map_freeblock_lock(); // メモリからの解放を禁止する
|
map_freeblock_lock(); // メモリからの解放を禁止する
|
||||||
|
|
||||||
@ -937,10 +926,8 @@ int map_foreachinmovearea(int (*func)(struct block_list*,va_list), struct block_
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(bl_list_count>=BL_LIST_MAX) {
|
if(bl_list_count>=BL_LIST_MAX)
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowWarning("map_foreachinmovearea: block count too many!\n");
|
ShowWarning("map_foreachinmovearea: block count too many!\n");
|
||||||
}
|
|
||||||
|
|
||||||
map_freeblock_lock(); // メモリからの解放を禁止する
|
map_freeblock_lock(); // メモリからの解放を禁止する
|
||||||
|
|
||||||
@ -996,10 +983,8 @@ int map_foreachincell(int (*func)(struct block_list*,va_list), int m, int x, int
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(bl_list_count>=BL_LIST_MAX) {
|
if(bl_list_count>=BL_LIST_MAX)
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowWarning("map_foreachincell: block count too many!\n");
|
ShowWarning("map_foreachincell: block count too many!\n");
|
||||||
}
|
|
||||||
|
|
||||||
map_freeblock_lock(); // メモリからの解放を禁止する
|
map_freeblock_lock(); // メモリからの解放を禁止する
|
||||||
|
|
||||||
@ -1192,10 +1177,8 @@ int map_foreachinpath(int (*func)(struct block_list*,va_list),int m,int x0,int y
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(bl_list_count>=BL_LIST_MAX) {
|
if(bl_list_count>=BL_LIST_MAX)
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowWarning("map_foreachinpath: block count too many!\n");
|
ShowWarning("map_foreachinpath: block count too many!\n");
|
||||||
}
|
|
||||||
|
|
||||||
map_freeblock_lock();
|
map_freeblock_lock();
|
||||||
|
|
||||||
@ -1249,10 +1232,8 @@ int map_foreachinmap(int (*func)(struct block_list*,va_list), int m, int type,..
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(bl_list_count>=BL_LIST_MAX) {
|
if(bl_list_count>=BL_LIST_MAX)
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowWarning("map_foreachinmap: block count too many!\n");
|
ShowWarning("map_foreachinmap: block count too many!\n");
|
||||||
}
|
|
||||||
|
|
||||||
map_freeblock_lock(); // メモリからの解放を禁止する
|
map_freeblock_lock(); // メモリからの解放を禁止する
|
||||||
|
|
||||||
@ -1284,7 +1265,6 @@ int map_addobject(struct block_list *bl)
|
|||||||
first_free_object_id=2;
|
first_free_object_id=2;
|
||||||
for(i=first_free_object_id;i<MAX_FLOORITEM && objects[i];i++);
|
for(i=first_free_object_id;i<MAX_FLOORITEM && objects[i];i++);
|
||||||
if(i>=MAX_FLOORITEM){
|
if(i>=MAX_FLOORITEM){
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowWarning("no free object id\n");
|
ShowWarning("no free object id\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1355,7 +1335,6 @@ void map_foreachobject(int (*func)(struct block_list*,va_list),int type,...)
|
|||||||
if(!(objects[i]->type==type)) // Fixed [Lance]
|
if(!(objects[i]->type==type)) // Fixed [Lance]
|
||||||
continue;
|
continue;
|
||||||
if(bl_list_count>=BL_LIST_MAX) {
|
if(bl_list_count>=BL_LIST_MAX) {
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowWarning("map_foreachobject: too many blocks !\n");
|
ShowWarning("map_foreachobject: too many blocks !\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1389,7 +1368,6 @@ int map_clearflooritem_timer(int tid,unsigned int tick,int id,int data)
|
|||||||
|
|
||||||
fitem = (struct flooritem_data *)objects[id];
|
fitem = (struct flooritem_data *)objects[id];
|
||||||
if(fitem==NULL || fitem->bl.type!=BL_ITEM || (!data && fitem->cleartimer != tid)){
|
if(fitem==NULL || fitem->bl.type!=BL_ITEM || (!data && fitem->cleartimer != tid)){
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("map_clearflooritem_timer : error\n");
|
ShowError("map_clearflooritem_timer : error\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -1951,7 +1929,6 @@ int map_addnpc(int m,struct npc_data *nd)
|
|||||||
if(map[m].npc[i]==NULL)
|
if(map[m].npc[i]==NULL)
|
||||||
break;
|
break;
|
||||||
if(i==MAX_NPC_PER_MAP){
|
if(i==MAX_NPC_PER_MAP){
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowWarning("too many NPCs in one map %s\n",map[m].name);
|
ShowWarning("too many NPCs in one map %s\n",map[m].name);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -2059,13 +2036,11 @@ int map_removemobs_timer(int tid, unsigned int tick, int id, int data)
|
|||||||
int k;
|
int k;
|
||||||
if (id < 0 || id >= MAX_MAP_PER_SERVER)
|
if (id < 0 || id >= MAX_MAP_PER_SERVER)
|
||||||
{ //Incorrect map id!
|
{ //Incorrect map id!
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("map_removemobs_timer error: timer %d points to invalid map %d\n",tid, id);
|
ShowError("map_removemobs_timer error: timer %d points to invalid map %d\n",tid, id);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (map[id].mob_delete_timer != tid)
|
if (map[id].mob_delete_timer != tid)
|
||||||
{ //Incorrect timer call!
|
{ //Incorrect timer call!
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("map_removemobs_timer mismatch: %d != %d (map %s)\n",map[id].mob_delete_timer, tid, map[id].name);
|
ShowError("map_removemobs_timer mismatch: %d != %d (map %s)\n",map[id].mob_delete_timer, tid, map[id].name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -492,7 +492,6 @@ static int merc_hom_hungry(int tid,unsigned int tick,int id,int data)
|
|||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if(hd->hungry_timer != tid){
|
if(hd->hungry_timer != tid){
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("merc_hom_hungry_timer %d != %d\n",hd->hungry_timer,tid);
|
ShowError("merc_hom_hungry_timer %d != %d\n",hd->hungry_timer,tid);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -253,7 +253,6 @@ int mob_get_random_id(int type, int flag, int lv)
|
|||||||
struct mob_db *mob;
|
struct mob_db *mob;
|
||||||
int i=0, class_;
|
int i=0, class_;
|
||||||
if(type < 0 || type >= MAX_RANDOMMONSTER) {
|
if(type < 0 || type >= MAX_RANDOMMONSTER) {
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("mob_get_random_id: Invalid type (%d) of random monster.\n", type);
|
ShowError("mob_get_random_id: Invalid type (%d) of random monster.\n", type);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1067,7 +1066,6 @@ int mob_randomwalk(struct mob_data *md,unsigned int tick)
|
|||||||
if(i==retrycount){
|
if(i==retrycount){
|
||||||
md->move_fail_count++;
|
md->move_fail_count++;
|
||||||
if(md->move_fail_count>1000){
|
if(md->move_fail_count>1000){
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowWarning("MOB can't move. random spawn %d, class = %d, at %s (%d,%d)\n",md->bl.id,md->class_,map[md->bl.m].name, md->bl.x, md->bl.y);
|
ShowWarning("MOB can't move. random spawn %d, class = %d, at %s (%d,%d)\n",md->bl.id,md->class_,map[md->bl.m].name, md->bl.x, md->bl.y);
|
||||||
md->move_fail_count=0;
|
md->move_fail_count=0;
|
||||||
mob_spawn(md);
|
mob_spawn(md);
|
||||||
@ -3902,14 +3900,12 @@ static int mob_readskilldb(void)
|
|||||||
{ //Ground skill.
|
{ //Ground skill.
|
||||||
if (ms->target > MST_AROUND)
|
if (ms->target > MST_AROUND)
|
||||||
{
|
{
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowWarning("Wrong mob skill target for ground skill %d (%s) for %s.\n",
|
ShowWarning("Wrong mob skill target for ground skill %d (%s) for %s.\n",
|
||||||
ms->skill_id, skill_get_name(ms->skill_id),
|
ms->skill_id, skill_get_name(ms->skill_id),
|
||||||
mob_id < 0?"all mobs":mob_db_data[mob_id]->sprite);
|
mob_id < 0?"all mobs":mob_db_data[mob_id]->sprite);
|
||||||
ms->target = MST_TARGET;
|
ms->target = MST_TARGET;
|
||||||
}
|
}
|
||||||
} else if (ms->target > MST_MASTER) {
|
} else if (ms->target > MST_MASTER) {
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowWarning("Wrong mob skill target 'around' for non-ground skill %d (%s) for %s\n.",
|
ShowWarning("Wrong mob skill target 'around' for non-ground skill %d (%s) for %s\n.",
|
||||||
ms->skill_id, skill_get_name(ms->skill_id),
|
ms->skill_id, skill_get_name(ms->skill_id),
|
||||||
mob_id < 0?"all mobs":mob_db_data[mob_id]->sprite);
|
mob_id < 0?"all mobs":mob_db_data[mob_id]->sprite);
|
||||||
|
@ -408,7 +408,6 @@ int npc_timerevent(int tid, unsigned int tick, int id, int data)
|
|||||||
if (ted->rid) {
|
if (ted->rid) {
|
||||||
sd = map_id2sd(ted->rid);
|
sd = map_id2sd(ted->rid);
|
||||||
if (!sd) {
|
if (!sd) {
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("npc_timerevent: Attached player not found.\n");
|
ShowError("npc_timerevent: Attached player not found.\n");
|
||||||
ers_free(timer_event_ers, ted);
|
ers_free(timer_event_ers, ted);
|
||||||
return 0;
|
return 0;
|
||||||
@ -474,7 +473,6 @@ int npc_timerevent_start(struct npc_data* nd, int rid)
|
|||||||
//Try to attach timer to this player.
|
//Try to attach timer to this player.
|
||||||
sd = map_id2sd(nd->u.scr.rid);
|
sd = map_id2sd(nd->u.scr.rid);
|
||||||
if (!sd) {
|
if (!sd) {
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("npc_timerevent_start: Attached player not found!\n");
|
ShowError("npc_timerevent_start: Attached player not found!\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -517,7 +515,6 @@ int npc_timerevent_stop(struct npc_data* nd)
|
|||||||
if (nd->u.scr.rid) {
|
if (nd->u.scr.rid) {
|
||||||
sd = map_id2sd(nd->u.scr.rid);
|
sd = map_id2sd(nd->u.scr.rid);
|
||||||
if (!sd) {
|
if (!sd) {
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("npc_timerevent_stop: Attached player not found!\n");
|
ShowError("npc_timerevent_stop: Attached player not found!\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -617,7 +614,6 @@ int npc_settimerevent_tick(struct npc_data* nd, int newtimer)
|
|||||||
if (nd->u.scr.rid) {
|
if (nd->u.scr.rid) {
|
||||||
sd = map_id2sd(nd->u.scr.rid);
|
sd = map_id2sd(nd->u.scr.rid);
|
||||||
if (!sd) {
|
if (!sd) {
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("npc_settimerevent_tick: Attached player not found!\n");
|
ShowError("npc_settimerevent_tick: Attached player not found!\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -643,7 +639,6 @@ int npc_event_sub(struct map_session_data* sd, struct event_data* ev, const char
|
|||||||
if( i < MAX_EVENTQUEUE )
|
if( i < MAX_EVENTQUEUE )
|
||||||
safestrncpy(sd->eventqueue[i],eventname,50); //Event enqueued.
|
safestrncpy(sd->eventqueue[i],eventname,50); //Event enqueued.
|
||||||
else
|
else
|
||||||
if( battle_config.error_log )
|
|
||||||
ShowWarning("npc_event: event queue is full !\n");
|
ShowWarning("npc_event: event queue is full !\n");
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
@ -687,7 +682,6 @@ int npc_event(struct map_session_data* sd, const char* eventname, int mob_kill)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("npc_event: event not found [%s]\n", eventname);
|
ShowError("npc_event: event not found [%s]\n", eventname);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -748,10 +742,8 @@ int npc_touch_areanpc(struct map_session_data* sd, int m, int x, int y)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (i==map[m].npc_num) {
|
if (i==map[m].npc_num) {
|
||||||
if (f) {
|
if (f)
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("npc_touch_areanpc : some bug \n");
|
ShowError("npc_touch_areanpc : some bug \n");
|
||||||
}
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
switch(map[m].npc[i]->bl.subtype) {
|
switch(map[m].npc[i]->bl.subtype) {
|
||||||
@ -946,7 +938,6 @@ int npc_click(struct map_session_data* sd, struct npc_data* nd)
|
|||||||
nullpo_retr(1, sd);
|
nullpo_retr(1, sd);
|
||||||
|
|
||||||
if (sd->npc_id != 0) {
|
if (sd->npc_id != 0) {
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("npc_click: npc_id != 0\n");
|
ShowError("npc_click: npc_id != 0\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -1010,7 +1001,6 @@ int npc_buysellsel(struct map_session_data* sd, int id, int type)
|
|||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (nd->bl.subtype!=SHOP) {
|
if (nd->bl.subtype!=SHOP) {
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("no such shop npc : %d\n",id);
|
ShowError("no such shop npc : %d\n",id);
|
||||||
if (sd->npc_id == id)
|
if (sd->npc_id == id)
|
||||||
sd->npc_id=0;
|
sd->npc_id=0;
|
||||||
@ -2674,7 +2664,6 @@ int npc_script_event(struct map_session_data* sd, int type)
|
|||||||
if (type < 0 || type >= NPCE_MAX)
|
if (type < 0 || type >= NPCE_MAX)
|
||||||
return 0;
|
return 0;
|
||||||
if (!sd) {
|
if (!sd) {
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("npc_script_event: NULL sd. Event Type %d\n", type);
|
ShowError("npc_script_event: NULL sd. Event Type %d\n", type);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -2789,7 +2778,7 @@ int npc_reload(void)
|
|||||||
if (map[m].moblist[i]) aFree(map[m].moblist[i]);
|
if (map[m].moblist[i]) aFree(map[m].moblist[i]);
|
||||||
memset (map[m].moblist, 0, sizeof(map[m].moblist));
|
memset (map[m].moblist, 0, sizeof(map[m].moblist));
|
||||||
}
|
}
|
||||||
if (map[m].npc_num > 0 && battle_config.error_log)
|
if (map[m].npc_num > 0)
|
||||||
ShowWarning("npc_reload: %d npcs weren't removed at map %s!\n", map[m].npc_num, map[m].name);
|
ShowWarning("npc_reload: %d npcs weren't removed at map %s!\n", map[m].npc_num, map[m].name);
|
||||||
}
|
}
|
||||||
mob_clear_spawninfo();
|
mob_clear_spawninfo();
|
||||||
|
@ -162,7 +162,6 @@ int party_check_member(struct party *p)
|
|||||||
|
|
||||||
if(f){
|
if(f){
|
||||||
sd->status.party_id=0;
|
sd->status.party_id=0;
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowWarning("party: check_member %d[%s] is not member\n",sd->status.account_id,sd->status.name);
|
ShowWarning("party: check_member %d[%s] is not member\n",sd->status.account_id,sd->status.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -343,7 +342,6 @@ int party_member_added(int party_id,int account_id,int char_id, int flag)
|
|||||||
int i;
|
int i;
|
||||||
if(sd == NULL || sd->status.char_id != char_id){
|
if(sd == NULL || sd->status.char_id != char_id){
|
||||||
if (flag == 0) {
|
if (flag == 0) {
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("party: member added error %d is not online\n",account_id);
|
ShowError("party: member added error %d is not online\n",account_id);
|
||||||
intif_party_leave(party_id,account_id,char_id);
|
intif_party_leave(party_id,account_id,char_id);
|
||||||
}
|
}
|
||||||
@ -353,7 +351,6 @@ int party_member_added(int party_id,int account_id,int char_id, int flag)
|
|||||||
sd->party_invite_account=0;
|
sd->party_invite_account=0;
|
||||||
|
|
||||||
if (!p) {
|
if (!p) {
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("party_member_added: party %d not found.\n",party_id);
|
ShowError("party_member_added: party %d not found.\n",party_id);
|
||||||
intif_party_leave(party_id,account_id,char_id);
|
intif_party_leave(party_id,account_id,char_id);
|
||||||
return 0;
|
return 0;
|
||||||
@ -530,7 +527,6 @@ int party_recv_movemap(int party_id,int account_id,int char_id, unsigned short m
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(i==MAX_PARTY){
|
if(i==MAX_PARTY){
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("party: not found member %d/%d on %d[%s]",account_id,char_id,party_id,p->party.name);
|
ShowError("party: not found member %d/%d on %d[%s]",account_id,char_id,party_id,p->party.name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -206,13 +206,11 @@ int path_blownpos(int m,int x0,int y0,int dx,int dy,int count)
|
|||||||
md = &map[m];
|
md = &map[m];
|
||||||
|
|
||||||
if( count>25 ){ //Cap to prevent too much processing...?
|
if( count>25 ){ //Cap to prevent too much processing...?
|
||||||
if( battle_config.error_log )
|
|
||||||
ShowWarning("path_blownpos: count too many %d !\n",count);
|
ShowWarning("path_blownpos: count too many %d !\n",count);
|
||||||
count=25;
|
count=25;
|
||||||
}
|
}
|
||||||
if( dx > 1 || dx < -1 || dy > 1 || dy < -1 ){
|
if( dx > 1 || dx < -1 || dy > 1 || dy < -1 ){
|
||||||
if( battle_config.error_log )
|
ShowError("path_blownpos: illegal dx=%d or dy=%d !\n",dx,dy);
|
||||||
ShowError("path_blownpos: illeagal dx=%d or dy=%d !\n",dx,dy);
|
|
||||||
dx=(dx>0)?1:((dx<0)?-1:0);
|
dx=(dx>0)?1:((dx<0)?-1:0);
|
||||||
dy=(dy>0)?1:((dy<0)?-1:0);
|
dy=(dy>0)?1:((dy<0)?-1:0);
|
||||||
}
|
}
|
||||||
|
47
src/map/pc.c
47
src/map/pc.c
@ -116,7 +116,6 @@ static int pc_invincible_timer(int tid,unsigned int tick,int id,int data)
|
|||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if(sd->invincible_timer != tid){
|
if(sd->invincible_timer != tid){
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("invincible_timer %d != %d\n",sd->invincible_timer,tid);
|
ShowError("invincible_timer %d != %d\n",sd->invincible_timer,tid);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -155,13 +154,11 @@ static int pc_spiritball_timer(int tid,unsigned int tick,int id,int data)
|
|||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if(sd->spirit_timer[0] != tid){
|
if(sd->spirit_timer[0] != tid){
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("spirit_timer %d != %d\n",sd->spirit_timer[0],tid);
|
ShowError("spirit_timer %d != %d\n",sd->spirit_timer[0],tid);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sd->spiritball <= 0) {
|
if(sd->spiritball <= 0) {
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("Spiritballs are already 0 when pc_spiritball_timer gets called");
|
ShowError("Spiritballs are already 0 when pc_spiritball_timer gets called");
|
||||||
sd->spiritball = 0;
|
sd->spiritball = 0;
|
||||||
return 0;
|
return 0;
|
||||||
@ -640,7 +637,6 @@ int pc_authok(struct map_session_data *sd, int login_id2, time_t connect_until_t
|
|||||||
//Set the map-server used job id. [Skotlex]
|
//Set the map-server used job id. [Skotlex]
|
||||||
i = pc_jobid2mapid(sd->status.class_);
|
i = pc_jobid2mapid(sd->status.class_);
|
||||||
if (i == -1) { //Invalid class?
|
if (i == -1) { //Invalid class?
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("pc_authok: Invalid class %d for player %s (%d:%d). Class was changed to novice.\n", sd->status.class_, sd->status.name, sd->status.account_id, sd->status.char_id);
|
ShowError("pc_authok: Invalid class %d for player %s (%d:%d). Class was changed to novice.\n", sd->status.class_, sd->status.name, sd->status.account_id, sd->status.char_id);
|
||||||
sd->status.class_ = JOB_NOVICE;
|
sd->status.class_ = JOB_NOVICE;
|
||||||
sd->class_ = MAPID_NOVICE;
|
sd->class_ = MAPID_NOVICE;
|
||||||
@ -703,7 +699,6 @@ int pc_authok(struct map_session_data *sd, int login_id2, time_t connect_until_t
|
|||||||
|
|
||||||
// ˆÊ’u‚Ì<E2809A>Ý’è
|
// ˆÊ’u‚Ì<E2809A>Ý’è
|
||||||
if ((i=pc_setpos(sd,sd->status.last_point.map, sd->status.last_point.x, sd->status.last_point.y, 0)) != 0) {
|
if ((i=pc_setpos(sd,sd->status.last_point.map, sd->status.last_point.x, sd->status.last_point.y, 0)) != 0) {
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError ("Last_point_map %s - id %d not found (error code %d)\n", mapindex_id2name(sd->status.last_point.map), sd->status.last_point.map, i);
|
ShowError ("Last_point_map %s - id %d not found (error code %d)\n", mapindex_id2name(sd->status.last_point.map), sd->status.last_point.map, i);
|
||||||
|
|
||||||
// try warping to a default map instead (church graveyard)
|
// try warping to a default map instead (church graveyard)
|
||||||
@ -955,7 +950,6 @@ int pc_calc_skilltree(struct map_session_data *sd)
|
|||||||
i = pc_calc_skilltree_normalize_job(sd);
|
i = pc_calc_skilltree_normalize_job(sd);
|
||||||
c = pc_mapid2jobid(i, sd->status.sex);
|
c = pc_mapid2jobid(i, sd->status.sex);
|
||||||
if (c == -1) { //Unable to normalize job??
|
if (c == -1) { //Unable to normalize job??
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("pc_calc_skilltree: Unable to normalize job %d for character %s (%d:%d)\n", i, sd->status.name, sd->status.account_id, sd->status.char_id);
|
ShowError("pc_calc_skilltree: Unable to normalize job %d for character %s (%d:%d)\n", i, sd->status.name, sd->status.account_id, sd->status.char_id);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -1075,7 +1069,6 @@ static void pc_check_skilltree(struct map_session_data *sd, int skill)
|
|||||||
i = pc_calc_skilltree_normalize_job(sd);
|
i = pc_calc_skilltree_normalize_job(sd);
|
||||||
c = pc_mapid2jobid(i, sd->status.sex);
|
c = pc_mapid2jobid(i, sd->status.sex);
|
||||||
if (c == -1) { //Unable to normalize job??
|
if (c == -1) { //Unable to normalize job??
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("pc_check_skilltree: Unable to normalize job %d for character %s (%d:%d)\n", i, sd->status.name, sd->status.account_id, sd->status.char_id);
|
ShowError("pc_check_skilltree: Unable to normalize job %d for character %s (%d:%d)\n", i, sd->status.name, sd->status.account_id, sd->status.char_id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1247,7 +1240,6 @@ int pc_autoscript_add(struct s_autoscript *scripts, int max, short rate, short f
|
|||||||
int i;
|
int i;
|
||||||
ARR_FIND(0, max, i, scripts[i].script == NULL);
|
ARR_FIND(0, max, i, scripts[i].script == NULL);
|
||||||
if (i == max) {
|
if (i == max) {
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowWarning("pc_autoscript_bonus: Reached max (%d) number of autoscripts per character!\n", max);
|
ShowWarning("pc_autoscript_bonus: Reached max (%d) number of autoscripts per character!\n", max);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1321,7 +1313,6 @@ static int pc_bonus_autospell(struct s_autospell *spell, int max, short id, shor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (i == max) {
|
if (i == max) {
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowWarning("pc_bonus: Reached max (%d) number of autospells per character!\n", max);
|
ShowWarning("pc_bonus: Reached max (%d) number of autospells per character!\n", max);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1357,7 +1348,6 @@ static int pc_bonus_addeff(struct s_addeffect* effect, int max, short id, short
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (i == max) {
|
if (i == max) {
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowWarning("pc_bonus: Reached max (%d) number of add effects per character!\n", max);
|
ShowWarning("pc_bonus: Reached max (%d) number of add effects per character!\n", max);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1406,7 +1396,6 @@ static int pc_bonus_item_drop(struct s_add_drop *drop, const short max, short id
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(i == max) {
|
if(i == max) {
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowWarning("pc_bonus: Reached max (%d) number of added drops per character!\n", max);
|
ShowWarning("pc_bonus: Reached max (%d) number of added drops per character!\n", max);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1516,7 +1505,6 @@ int pc_bonus(struct map_session_data *sd,int type,int val)
|
|||||||
break;
|
break;
|
||||||
case SP_ATKELE:
|
case SP_ATKELE:
|
||||||
if(val >= ELE_MAX) {
|
if(val >= ELE_MAX) {
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("pc_bonus: SP_ATKELE: Invalid element %d\n", val);
|
ShowError("pc_bonus: SP_ATKELE: Invalid element %d\n", val);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1548,7 +1536,6 @@ int pc_bonus(struct map_session_data *sd,int type,int val)
|
|||||||
break;
|
break;
|
||||||
case SP_DEFELE:
|
case SP_DEFELE:
|
||||||
if(val >= ELE_MAX) {
|
if(val >= ELE_MAX) {
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("pc_bonus: SP_DEFELE: Invalid element %d\n", val);
|
ShowError("pc_bonus: SP_DEFELE: Invalid element %d\n", val);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1664,7 +1651,6 @@ int pc_bonus(struct map_session_data *sd,int type,int val)
|
|||||||
break;
|
break;
|
||||||
case SP_IGNORE_DEF_ELE:
|
case SP_IGNORE_DEF_ELE:
|
||||||
if(val >= ELE_MAX) {
|
if(val >= ELE_MAX) {
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("pc_bonus: SP_IGNORE_DEF_ELE: Invalid element %d\n", val);
|
ShowError("pc_bonus: SP_IGNORE_DEF_ELE: Invalid element %d\n", val);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1699,7 +1685,6 @@ int pc_bonus(struct map_session_data *sd,int type,int val)
|
|||||||
break;
|
break;
|
||||||
case SP_IGNORE_MDEF_ELE:
|
case SP_IGNORE_MDEF_ELE:
|
||||||
if(val >= ELE_MAX) {
|
if(val >= ELE_MAX) {
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("pc_bonus: SP_IGNORE_MDEF_ELE: Invalid element %d\n", val);
|
ShowError("pc_bonus: SP_IGNORE_MDEF_ELE: Invalid element %d\n", val);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1724,7 +1709,6 @@ int pc_bonus(struct map_session_data *sd,int type,int val)
|
|||||||
break;
|
break;
|
||||||
case SP_DEF_RATIO_ATK_ELE:
|
case SP_DEF_RATIO_ATK_ELE:
|
||||||
if(val >= ELE_MAX) {
|
if(val >= ELE_MAX) {
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("pc_bonus: SP_DEF_RATIO_ATK_ELE: Invalid element %d\n", val);
|
ShowError("pc_bonus: SP_DEF_RATIO_ATK_ELE: Invalid element %d\n", val);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1735,7 +1719,6 @@ int pc_bonus(struct map_session_data *sd,int type,int val)
|
|||||||
break;
|
break;
|
||||||
case SP_DEF_RATIO_ATK_RACE:
|
case SP_DEF_RATIO_ATK_RACE:
|
||||||
if(val >= RC_MAX) {
|
if(val >= RC_MAX) {
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("pc_bonus: SP_DEF_RATIO_ATK_RACE: Invalid race %d\n", val);
|
ShowError("pc_bonus: SP_DEF_RATIO_ATK_RACE: Invalid race %d\n", val);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1965,7 +1948,6 @@ int pc_bonus(struct map_session_data *sd,int type,int val)
|
|||||||
sd->hp_gain_value += val;
|
sd->hp_gain_value += val;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowWarning("pc_bonus: unknown type %d %d !\n",type,val);
|
ShowWarning("pc_bonus: unknown type %d %d !\n",type,val);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1984,7 +1966,6 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
|
|||||||
switch(type){
|
switch(type){
|
||||||
case SP_ADDELE:
|
case SP_ADDELE:
|
||||||
if(type2 >= ELE_MAX) {
|
if(type2 >= ELE_MAX) {
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("pc_bonus2: SP_ADDELE: Invalid element %d\n", type2);
|
ShowError("pc_bonus2: SP_ADDELE: Invalid element %d\n", type2);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2013,7 +1994,6 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
|
|||||||
break;
|
break;
|
||||||
case SP_SUBELE:
|
case SP_SUBELE:
|
||||||
if(type2 >= ELE_MAX) {
|
if(type2 >= ELE_MAX) {
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("pc_bonus2: SP_SUBELE: Invalid element %d\n", type2);
|
ShowError("pc_bonus2: SP_SUBELE: Invalid element %d\n", type2);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2052,7 +2032,6 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
|
|||||||
break;
|
break;
|
||||||
case SP_MAGIC_ADDELE:
|
case SP_MAGIC_ADDELE:
|
||||||
if(type2 >= ELE_MAX) {
|
if(type2 >= ELE_MAX) {
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("pc_bonus2: SP_MAGIC_ADDELE: Invalid element %d\n", type2);
|
ShowError("pc_bonus2: SP_MAGIC_ADDELE: Invalid element %d\n", type2);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2215,7 +2194,6 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
|
|||||||
break;
|
break;
|
||||||
case SP_WEAPON_COMA_ELE:
|
case SP_WEAPON_COMA_ELE:
|
||||||
if(type2 >= ELE_MAX) {
|
if(type2 >= ELE_MAX) {
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("pc_bonus2: SP_WEAPON_COMA_ELE: Invalid element %d\n", type2);
|
ShowError("pc_bonus2: SP_WEAPON_COMA_ELE: Invalid element %d\n", type2);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2416,7 +2394,6 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowWarning("pc_bonus2: unknown type %d %d %d!\n",type,type2,val);
|
ShowWarning("pc_bonus2: unknown type %d %d %d!\n",type,type2,val);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2513,7 +2490,6 @@ int pc_bonus3(struct map_session_data *sd,int type,int type2,int type3,int val)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowWarning("pc_bonus3: unknown type %d %d %d %d!\n",type,type2,type3,val);
|
ShowWarning("pc_bonus3: unknown type %d %d %d %d!\n",type,type2,type3,val);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2536,7 +2512,6 @@ int pc_bonus4(struct map_session_data *sd,int type,int type2,int type3,int type4
|
|||||||
pc_bonus_autospell(sd->autospell2, ARRAYLENGTH(sd->autospell2), (val&1?type2:-type2), (val&2?-type3:type3), type4, 0, current_equip_card_id);
|
pc_bonus_autospell(sd->autospell2, ARRAYLENGTH(sd->autospell2), (val&1?type2:-type2), (val&2?-type3:type3), type4, 0, current_equip_card_id);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowWarning("pc_bonus4: unknown type %d %d %d %d %d!\n",type,type2,type3,type4,val);
|
ShowWarning("pc_bonus4: unknown type %d %d %d %d %d!\n",type,type2,type3,type4,val);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2559,7 +2534,6 @@ int pc_bonus5(struct map_session_data *sd,int type,int type2,int type3,int type4
|
|||||||
pc_bonus_autospell(sd->autospell2, ARRAYLENGTH(sd->autospell2), (val&1?type2:-type2), (val&2?-type3:type3), type4, type5, current_equip_card_id);
|
pc_bonus_autospell(sd->autospell2, ARRAYLENGTH(sd->autospell2), (val&1?type2:-type2), (val&2?-type3:type3), type4, type5, current_equip_card_id);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowWarning("pc_bonus5: unknown type %d %d %d %d %d %d!\n",type,type2,type3,type4,type5,val);
|
ShowWarning("pc_bonus5: unknown type %d %d %d %d %d %d!\n",type,type2,type3,type4,type5,val);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2579,12 +2553,10 @@ int pc_skill(TBL_PC* sd, int id, int level, int flag)
|
|||||||
nullpo_retr(0, sd);
|
nullpo_retr(0, sd);
|
||||||
|
|
||||||
if( id <= 0 || id >= MAX_SKILL || skill_db[id].name == NULL) {
|
if( id <= 0 || id >= MAX_SKILL || skill_db[id].name == NULL) {
|
||||||
if( battle_config.error_log )
|
|
||||||
ShowError("pc_skill: Skill with id %d does not exist in the skill database\n", id);
|
ShowError("pc_skill: Skill with id %d does not exist in the skill database\n", id);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if( level > MAX_SKILL_LEVEL ) {
|
if( level > MAX_SKILL_LEVEL ) {
|
||||||
if( battle_config.error_log )
|
|
||||||
ShowError("pc_skill: Skill level %d too high. Max lv supported is %d\n", level, MAX_SKILL_LEVEL);
|
ShowError("pc_skill: Skill level %d too high. Max lv supported is %d\n", level, MAX_SKILL_LEVEL);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -3526,7 +3498,6 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y
|
|||||||
!map_getcell(m, x, y, CELL_CHKICEWALL))
|
!map_getcell(m, x, y, CELL_CHKICEWALL))
|
||||||
){ //It is allowed on top of Moonlight/icewall tiles to prevent force-warping 'cheats' [Skotlex]
|
){ //It is allowed on top of Moonlight/icewall tiles to prevent force-warping 'cheats' [Skotlex]
|
||||||
if(x||y) {
|
if(x||y) {
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("pc_setpos: attempt to place player %s (%d:%d) on non-walkable tile (%s-%d,%d)\n", sd->status.name, sd->status.account_id, sd->status.char_id, mapindex_id2name(mapindex),x,y);
|
ShowError("pc_setpos: attempt to place player %s (%d:%d) on non-walkable tile (%s-%d,%d)\n", sd->status.name, sd->status.account_id, sd->status.char_id, mapindex_id2name(mapindex),x,y);
|
||||||
}
|
}
|
||||||
do {
|
do {
|
||||||
@ -4062,7 +4033,6 @@ int pc_follow_timer(int tid,unsigned int tick,int id,int data)
|
|||||||
nullpo_retr(0, sd);
|
nullpo_retr(0, sd);
|
||||||
|
|
||||||
if (sd->followtimer != tid){
|
if (sd->followtimer != tid){
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("pc_follow_timer %d != %d\n",sd->followtimer,tid);
|
ShowError("pc_follow_timer %d != %d\n",sd->followtimer,tid);
|
||||||
sd->followtimer = -1;
|
sd->followtimer = -1;
|
||||||
return 0;
|
return 0;
|
||||||
@ -4721,10 +4691,8 @@ int pc_resetstate(struct map_session_data* sd)
|
|||||||
int stat;
|
int stat;
|
||||||
if (sd->status.base_level > MAX_LEVEL)
|
if (sd->status.base_level > MAX_LEVEL)
|
||||||
{ //statp[] goes out of bounds, can't reset!
|
{ //statp[] goes out of bounds, can't reset!
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("pc_resetstate: Can't reset stats of %d:%d, the base level (%d) is greater than the max level supported (%d)\n",
|
ShowError("pc_resetstate: Can't reset stats of %d:%d, the base level (%d) is greater than the max level supported (%d)\n",
|
||||||
sd->status.account_id, sd->status.char_id, sd->status.base_level,
|
sd->status.account_id, sd->status.char_id, sd->status.base_level, MAX_LEVEL);
|
||||||
MAX_LEVEL);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
stat = statp[sd->status.base_level];
|
stat = statp[sd->status.base_level];
|
||||||
@ -6042,7 +6010,6 @@ int pc_readregistry(struct map_session_data *sd,const char *reg,int type)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (max == -1) {
|
if (max == -1) {
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("pc_readregistry: Trying to read reg value %s (type %d) before it's been loaded!\n", reg, type);
|
ShowError("pc_readregistry: Trying to read reg value %s (type %d) before it's been loaded!\n", reg, type);
|
||||||
//This really shouldn't happen, so it's possible the data was lost somewhere, we should request it again.
|
//This really shouldn't happen, so it's possible the data was lost somewhere, we should request it again.
|
||||||
intif_request_registry(sd,type==3?4:type);
|
intif_request_registry(sd,type==3?4:type);
|
||||||
@ -6078,7 +6045,6 @@ char* pc_readregistry_str(struct map_session_data *sd,char *reg,int type)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (max == -1) {
|
if (max == -1) {
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("pc_readregistry: Trying to read reg value %s (type %d) before it's been loaded!\n", reg, type);
|
ShowError("pc_readregistry: Trying to read reg value %s (type %d) before it's been loaded!\n", reg, type);
|
||||||
//This really shouldn't happen, so it's possible the data was lost somewhere, we should request it again.
|
//This really shouldn't happen, so it's possible the data was lost somewhere, we should request it again.
|
||||||
intif_request_registry(sd,type==3?4:type);
|
intif_request_registry(sd,type==3?4:type);
|
||||||
@ -6132,7 +6098,6 @@ int pc_setregistry(struct map_session_data *sd,const char *reg,int val,int type)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (*max == -1) {
|
if (*max == -1) {
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("pc_setregistry : refusing to set %s (type %d) until vars are received.\n", reg, type);
|
ShowError("pc_setregistry : refusing to set %s (type %d) until vars are received.\n", reg, type);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -6170,7 +6135,6 @@ int pc_setregistry(struct map_session_data *sd,const char *reg,int val,int type)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("pc_setregistry : couldn't set %s, limit of registries reached (%d)\n", reg, regmax);
|
ShowError("pc_setregistry : couldn't set %s, limit of registries reached (%d)\n", reg, regmax);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -6183,7 +6147,6 @@ int pc_setregistry_str(struct map_session_data *sd,char *reg,char *val,int type)
|
|||||||
|
|
||||||
nullpo_retr(0, sd);
|
nullpo_retr(0, sd);
|
||||||
if (reg[strlen(reg)-1] != '$') {
|
if (reg[strlen(reg)-1] != '$') {
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("pc_setregistry_str : reg %s must be string (end in '$') to use this!\n", reg);
|
ShowError("pc_setregistry_str : reg %s must be string (end in '$') to use this!\n", reg);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -6208,7 +6171,6 @@ int pc_setregistry_str(struct map_session_data *sd,char *reg,char *val,int type)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (*max == -1) {
|
if (*max == -1) {
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("pc_setregistry_str : refusing to set %s (type %d) until vars are received.\n", reg, type);
|
ShowError("pc_setregistry_str : refusing to set %s (type %d) until vars are received.\n", reg, type);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -6249,7 +6211,6 @@ int pc_setregistry_str(struct map_session_data *sd,char *reg,char *val,int type)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("pc_setregistry : couldn't set %s, limit of registries reached (%d)\n", reg, regmax);
|
ShowError("pc_setregistry : couldn't set %s, limit of registries reached (%d)\n", reg, regmax);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -6273,7 +6234,7 @@ static int pc_eventtimer(int tid,unsigned int tick,int id,int data)
|
|||||||
sd->eventcount--;
|
sd->eventcount--;
|
||||||
npc_event(sd,p,0);
|
npc_event(sd,p,0);
|
||||||
}
|
}
|
||||||
else if( battle_config.error_log )
|
else
|
||||||
ShowError("pc_eventtimer: no such event timer\n");
|
ShowError("pc_eventtimer: no such event timer\n");
|
||||||
|
|
||||||
if (p) aFree(p);
|
if (p) aFree(p);
|
||||||
@ -6636,7 +6597,6 @@ int pc_checkitem(struct map_session_data *sd)
|
|||||||
if( (id=sd->status.inventory[i].nameid)==0)
|
if( (id=sd->status.inventory[i].nameid)==0)
|
||||||
continue;
|
continue;
|
||||||
if( battle_config.item_check && !itemdb_available(id) ){
|
if( battle_config.item_check && !itemdb_available(id) ){
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowWarning("illegal item id %d in %d[%s] inventory.\n",id,sd->bl.id,sd->status.name);
|
ShowWarning("illegal item id %d in %d[%s] inventory.\n",id,sd->bl.id,sd->status.name);
|
||||||
pc_delitem(sd,i,sd->status.inventory[i].amount,3);
|
pc_delitem(sd,i,sd->status.inventory[i].amount,3);
|
||||||
continue;
|
continue;
|
||||||
@ -6657,7 +6617,6 @@ int pc_checkitem(struct map_session_data *sd)
|
|||||||
if( (id=sd->status.cart[i].nameid)==0 )
|
if( (id=sd->status.cart[i].nameid)==0 )
|
||||||
continue;
|
continue;
|
||||||
if( battle_config.item_check && !itemdb_available(id) ){
|
if( battle_config.item_check && !itemdb_available(id) ){
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowWarning("illegal item id %d in %d[%s] cart.\n",id,sd->bl.id,sd->status.name);
|
ShowWarning("illegal item id %d in %d[%s] cart.\n",id,sd->bl.id,sd->status.name);
|
||||||
pc_cart_delitem(sd,i,sd->status.cart[i].amount,1);
|
pc_cart_delitem(sd,i,sd->status.cart[i].amount,1);
|
||||||
continue;
|
continue;
|
||||||
@ -7599,7 +7558,7 @@ int pc_read_motd(void)
|
|||||||
}
|
}
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
else if(battle_config.error_log)
|
else
|
||||||
ShowWarning("In function pc_read_motd() -> File '"CL_WHITE"%s"CL_RESET"' not found.\n", motd_txt);
|
ShowWarning("In function pc_read_motd() -> File '"CL_WHITE"%s"CL_RESET"' not found.\n", motd_txt);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -241,7 +241,6 @@ static int pet_hungry(int tid,unsigned int tick,int id,int data)
|
|||||||
|
|
||||||
pd = sd->pd;
|
pd = sd->pd;
|
||||||
if(pd->pet_hungry_timer != tid){
|
if(pd->pet_hungry_timer != tid){
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("pet_hungry_timer %d != %d\n",pd->pet_hungry_timer,tid);
|
ShowError("pet_hungry_timer %d != %d\n",pd->pet_hungry_timer,tid);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -480,7 +479,6 @@ int pet_recv_petdata(int account_id,struct s_pet *p,int flag)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(i >= MAX_INVENTORY) {
|
if(i >= MAX_INVENTORY) {
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("pet_recv_petdata: Hatching pet (%d:%s) aborted, couldn't find egg in inventory for removal!\n",p->pet_id, p->name);
|
ShowError("pet_recv_petdata: Hatching pet (%d:%s) aborted, couldn't find egg in inventory for removal!\n",p->pet_id, p->name);
|
||||||
sd->status.pet_id = 0;
|
sd->status.pet_id = 0;
|
||||||
return 1;
|
return 1;
|
||||||
@ -511,10 +509,9 @@ int pet_select_egg(struct map_session_data *sd,short egg_index)
|
|||||||
|
|
||||||
if(sd->status.inventory[egg_index].card[0] == CARD0_PET)
|
if(sd->status.inventory[egg_index].card[0] == CARD0_PET)
|
||||||
intif_request_petdata(sd->status.account_id, sd->status.char_id, MakeDWord(sd->status.inventory[egg_index].card[1], sd->status.inventory[egg_index].card[2]) );
|
intif_request_petdata(sd->status.account_id, sd->status.char_id, MakeDWord(sd->status.inventory[egg_index].card[1], sd->status.inventory[egg_index].card[2]) );
|
||||||
else {
|
else
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("wrong egg item inventory %d\n",egg_index);
|
ShowError("wrong egg item inventory %d\n",egg_index);
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -831,7 +828,6 @@ static int pet_randomwalk(struct pet_data *pd,unsigned int tick)
|
|||||||
if(i+1>=retrycount){
|
if(i+1>=retrycount){
|
||||||
pd->move_fail_count++;
|
pd->move_fail_count++;
|
||||||
if(pd->move_fail_count>1000){
|
if(pd->move_fail_count>1000){
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowWarning("PET can't move. hold position %d, class = %d\n",pd->bl.id,pd->pet.class_);
|
ShowWarning("PET can't move. hold position %d, class = %d\n",pd->bl.id,pd->pet.class_);
|
||||||
pd->move_fail_count=0;
|
pd->move_fail_count=0;
|
||||||
pd->ud.canmove_tick = tick + 60000;
|
pd->ud.canmove_tick = tick + 60000;
|
||||||
@ -1088,11 +1084,8 @@ int pet_skill_bonus_timer(int tid,unsigned int tick,int id,int data)
|
|||||||
pd=sd->pd;
|
pd=sd->pd;
|
||||||
|
|
||||||
if(pd->bonus->timer != tid) {
|
if(pd->bonus->timer != tid) {
|
||||||
if(battle_config.error_log)
|
|
||||||
{
|
|
||||||
ShowError("pet_skill_bonus_timer %d != %d\n",pd->bonus->timer,tid);
|
ShowError("pet_skill_bonus_timer %d != %d\n",pd->bonus->timer,tid);
|
||||||
pd->bonus->timer = -1;
|
pd->bonus->timer = -1;
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1131,7 +1124,6 @@ int pet_recovery_timer(int tid,unsigned int tick,int id,int data)
|
|||||||
pd=sd->pd;
|
pd=sd->pd;
|
||||||
|
|
||||||
if(pd->recovery->timer != tid) {
|
if(pd->recovery->timer != tid) {
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("pet_recovery_timer %d != %d\n",pd->recovery->timer,tid);
|
ShowError("pet_recovery_timer %d != %d\n",pd->recovery->timer,tid);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1162,7 +1154,6 @@ int pet_heal_timer(int tid,unsigned int tick,int id,int data)
|
|||||||
pd=sd->pd;
|
pd=sd->pd;
|
||||||
|
|
||||||
if(pd->s_skill->timer != tid) {
|
if(pd->s_skill->timer != tid) {
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("pet_heal_timer %d != %d\n",pd->s_skill->timer,tid);
|
ShowError("pet_heal_timer %d != %d\n",pd->s_skill->timer,tid);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1200,7 +1191,6 @@ int pet_skill_support_timer(int tid,unsigned int tick,int id,int data)
|
|||||||
pd=sd->pd;
|
pd=sd->pd;
|
||||||
|
|
||||||
if(pd->s_skill->timer != tid) {
|
if(pd->s_skill->timer != tid) {
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("pet_skill_support_timer %d != %d\n",pd->s_skill->timer,tid);
|
ShowError("pet_skill_support_timer %d != %d\n",pd->s_skill->timer,tid);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -2546,10 +2546,9 @@ int get_com(unsigned char *script,int *pos)
|
|||||||
*------------------------------------------*/
|
*------------------------------------------*/
|
||||||
void unget_com(int c)
|
void unget_com(int c)
|
||||||
{
|
{
|
||||||
if(unget_com_data!=-1){
|
if(unget_com_data!=-1)
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("unget_com can back only 1 data\n");
|
ShowError("unget_com can back only 1 data\n");
|
||||||
}
|
|
||||||
unget_com_data=c;
|
unget_com_data=c;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2827,7 +2826,6 @@ int run_func(struct script_state *st)
|
|||||||
end_sp=st->stack->sp;
|
end_sp=st->stack->sp;
|
||||||
for(i=end_sp-1;i>=0 && st->stack->stack_data[i].type!=C_ARG;i--);
|
for(i=end_sp-1;i>=0 && st->stack->stack_data[i].type!=C_ARG;i--);
|
||||||
if(i<=0){ //Crash fix when missing "push_val" causes current pointer to become -1. from Rayce (jA)
|
if(i<=0){ //Crash fix when missing "push_val" causes current pointer to become -1. from Rayce (jA)
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("function not found\n");
|
ShowError("function not found\n");
|
||||||
// st->stack->sp=0;
|
// st->stack->sp=0;
|
||||||
st->state=END;
|
st->state=END;
|
||||||
@ -2887,7 +2885,6 @@ int run_func(struct script_state *st)
|
|||||||
if (str_data[func].func(st)) //Report error
|
if (str_data[func].func(st)) //Report error
|
||||||
script_reportsrc(st);
|
script_reportsrc(st);
|
||||||
} else {
|
} else {
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("run_func : %s? (%d(%d))\n",str_buf+str_data[func].str,func,str_data[func].type);
|
ShowError("run_func : %s? (%d(%d))\n",str_buf+str_data[func].str,func,str_data[func].type);
|
||||||
script_pushint(st,0);
|
script_pushint(st,0);
|
||||||
script_reportsrc(st);
|
script_reportsrc(st);
|
||||||
@ -3069,7 +3066,7 @@ void run_script_main(struct script_state *st)
|
|||||||
{ //sp > defsp is valid in cases when you invoke functions and don't use the returned value. [Skotlex]
|
{ //sp > defsp is valid in cases when you invoke functions and don't use the returned value. [Skotlex]
|
||||||
//Since sp is supposed to be defsp in these cases, we could assume the extra stack elements are unneeded.
|
//Since sp is supposed to be defsp in these cases, we could assume the extra stack elements are unneeded.
|
||||||
pop_stack(stack, stack->defsp, stack->sp); //Clear out the unused stack-section.
|
pop_stack(stack, stack->defsp, stack->sp); //Clear out the unused stack-section.
|
||||||
} else if( battle_config.error_log )
|
} else
|
||||||
ShowError("script:run_script_main: unexpected stack position stack.sp(%d) != default(%d)\n", stack->sp, stack->defsp);
|
ShowError("script:run_script_main: unexpected stack position stack.sp(%d) != default(%d)\n", stack->sp, stack->defsp);
|
||||||
stack->sp = stack->defsp;
|
stack->sp = stack->defsp;
|
||||||
}
|
}
|
||||||
@ -3137,7 +3134,6 @@ void run_script_main(struct script_state *st)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("unknown command : %d @ %d\n",c,st->pos);
|
ShowError("unknown command : %d @ %d\n",c,st->pos);
|
||||||
st->state=END;
|
st->state=END;
|
||||||
break;
|
break;
|
||||||
@ -5202,11 +5198,8 @@ BUILDIN_FUNC(countitem)
|
|||||||
nameid = conv_num(st,data);
|
nameid = conv_num(st,data);
|
||||||
|
|
||||||
if (nameid < 500) {
|
if (nameid < 500) {
|
||||||
if(battle_config.error_log)
|
|
||||||
{
|
|
||||||
ShowError("wrong item ID : countitem(%i)\n", nameid);
|
ShowError("wrong item ID : countitem(%i)\n", nameid);
|
||||||
script_reportsrc(st);
|
script_reportsrc(st);
|
||||||
}
|
|
||||||
script_pushint(st,0);
|
script_pushint(st,0);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -5257,7 +5250,7 @@ BUILDIN_FUNC(countitem2)
|
|||||||
c4 = (short)script_getnum(st,9);
|
c4 = (short)script_getnum(st,9);
|
||||||
|
|
||||||
if (nameid < 500) {
|
if (nameid < 500) {
|
||||||
if(battle_config.error_log) ShowError("wrong item ID : countitem2(%i)\n", nameid);
|
ShowError("wrong item ID : countitem2(%i)\n", nameid);
|
||||||
script_pushint(st,0);
|
script_pushint(st,0);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -7612,7 +7605,6 @@ BUILDIN_FUNC(getnpctimer)
|
|||||||
if (!nd || nd->bl.type != BL_NPC)
|
if (!nd || nd->bl.type != BL_NPC)
|
||||||
{
|
{
|
||||||
script_pushint(st,0);
|
script_pushint(st,0);
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("getnpctimer: Invalid NPC\n");
|
ShowError("getnpctimer: Invalid NPC\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -7623,7 +7615,6 @@ BUILDIN_FUNC(getnpctimer)
|
|||||||
if (nd->u.scr.rid) {
|
if (nd->u.scr.rid) {
|
||||||
sd = map_id2sd(nd->u.scr.rid);
|
sd = map_id2sd(nd->u.scr.rid);
|
||||||
if (!sd) {
|
if (!sd) {
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("buildin_getnpctimer: Attached player not found!\n");
|
ShowError("buildin_getnpctimer: Attached player not found!\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -10802,7 +10793,7 @@ BUILDIN_FUNC(getsavepoint)
|
|||||||
/*==========================================
|
/*==========================================
|
||||||
* Get position for char/npc/pet/mob objects. Added by Lorky
|
* Get position for char/npc/pet/mob objects. Added by Lorky
|
||||||
*
|
*
|
||||||
* int getMapXY(MapName$,MaxX,MapY,type,[CharName$]);
|
* int getMapXY(MapName$,MapX,MapY,type,[CharName$]);
|
||||||
* where type:
|
* where type:
|
||||||
* MapName$ - String variable for output map name
|
* MapName$ - String variable for output map name
|
||||||
* MapX - Integer variable for output coord X
|
* MapX - Integer variable for output coord X
|
||||||
@ -11328,7 +11319,6 @@ BUILDIN_FUNC(equip)
|
|||||||
nameid=script_getnum(st,2);
|
nameid=script_getnum(st,2);
|
||||||
if((item_data = itemdb_exists(nameid)) == NULL)
|
if((item_data = itemdb_exists(nameid)) == NULL)
|
||||||
{
|
{
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("wrong item ID : equipitem(%i)\n",nameid);
|
ShowError("wrong item ID : equipitem(%i)\n",nameid);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -5307,7 +5307,7 @@ int skill_castend_id (int tid, unsigned int tick, int id, int data)
|
|||||||
unit_set_walkdelay(src, tick, battle_config.default_walk_delay+skill_get_walkdelay(ud->skillid, ud->skilllv), 1);
|
unit_set_walkdelay(src, tick, battle_config.default_walk_delay+skill_get_walkdelay(ud->skillid, ud->skilllv), 1);
|
||||||
|
|
||||||
if(battle_config.skill_log && battle_config.skill_log&src->type)
|
if(battle_config.skill_log && battle_config.skill_log&src->type)
|
||||||
ShowInfo("Type %d, ID %d skill castend id [id =%d, lv=%d, target ID %d)\n",
|
ShowInfo("Type %d, ID %d skill castend id [id =%d, lv=%d, target ID %d]\n",
|
||||||
src->type, src->id, ud->skillid, ud->skilllv, target->id);
|
src->type, src->id, ud->skillid, ud->skilllv, target->id);
|
||||||
|
|
||||||
map_freeblock_lock();
|
map_freeblock_lock();
|
||||||
@ -6657,7 +6657,6 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
|
|||||||
case UNT_FIREPILLAR_ACTIVE:
|
case UNT_FIREPILLAR_ACTIVE:
|
||||||
return 0;
|
return 0;
|
||||||
default:
|
default:
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("skill_unit_onplace_timer: interval error (unit id %x)\n", sg->unit_id);
|
ShowError("skill_unit_onplace_timer: interval error (unit id %x)\n", sg->unit_id);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -9499,9 +9498,7 @@ struct skill_unit_group_tickset *skill_unitgrouptickset_search (struct block_lis
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (j == -1) {
|
if (j == -1) {
|
||||||
if(battle_config.error_log) {
|
|
||||||
ShowWarning ("skill_unitgrouptickset_search: tickset is full\n");
|
ShowWarning ("skill_unitgrouptickset_search: tickset is full\n");
|
||||||
}
|
|
||||||
j = id % MAX_SKILLUNITGROUPTICKSET;
|
j = id % MAX_SKILLUNITGROUPTICKSET;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -9747,7 +9744,7 @@ int skill_unit_move_sub (struct block_list* bl, va_list ap)
|
|||||||
ARR_FIND( 0, ARRAYLENGTH(skill_unit_temp), i, skill_unit_temp[i] == 0 );
|
ARR_FIND( 0, ARRAYLENGTH(skill_unit_temp), i, skill_unit_temp[i] == 0 );
|
||||||
if( i < ARRAYLENGTH(skill_unit_temp) )
|
if( i < ARRAYLENGTH(skill_unit_temp) )
|
||||||
skill_unit_temp[i] = skill_id;
|
skill_unit_temp[i] = skill_id;
|
||||||
else if( battle_config.error_log )
|
else
|
||||||
ShowError("skill_unit_move_sub: Reached limit of unit objects per cell!\n");
|
ShowError("skill_unit_move_sub: Reached limit of unit objects per cell!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -9781,7 +9778,7 @@ int skill_unit_move_sub (struct block_list* bl, va_list ap)
|
|||||||
ARR_FIND( 0, ARRAYLENGTH(skill_unit_temp), i, skill_unit_temp[i] == 0 );
|
ARR_FIND( 0, ARRAYLENGTH(skill_unit_temp), i, skill_unit_temp[i] == 0 );
|
||||||
if( i < ARRAYLENGTH(skill_unit_temp) )
|
if( i < ARRAYLENGTH(skill_unit_temp) )
|
||||||
skill_unit_temp[i] = skill_id;
|
skill_unit_temp[i] = skill_id;
|
||||||
else if( battle_config.error_log )
|
else
|
||||||
ShowError("skill_unit_move_sub: Reached limit of unit objects per cell!\n");
|
ShowError("skill_unit_move_sub: Reached limit of unit objects per cell!\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -10030,10 +10027,8 @@ int skill_produce_mix (struct map_session_data *sd, int skill_id, int nameid, in
|
|||||||
y = sd->status.inventory[j].amount;
|
y = sd->status.inventory[j].amount;
|
||||||
if(y>x)y=x;
|
if(y>x)y=x;
|
||||||
pc_delitem(sd,j,y,0);
|
pc_delitem(sd,j,y,0);
|
||||||
}else {
|
} else
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("skill_produce_mix: material item error\n");
|
ShowError("skill_produce_mix: material item error\n");
|
||||||
}
|
|
||||||
|
|
||||||
x-=y;
|
x-=y;
|
||||||
}while( j>=0 && x>0 );
|
}while( j>=0 && x>0 );
|
||||||
|
@ -70,7 +70,6 @@ static void add_sc(int skill, int sc)
|
|||||||
else
|
else
|
||||||
if (sk >= HM_SKILLBASE) sk = skill - HM_SKILLBASE + SC_HM_BASE;
|
if (sk >= HM_SKILLBASE) sk = skill - HM_SKILLBASE + SC_HM_BASE;
|
||||||
if (sk < 0 || sk >= MAX_SKILL) {
|
if (sk < 0 || sk >= MAX_SKILL) {
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("add_sc: Unsupported skill id %d\n", skill);
|
ShowError("add_sc: Unsupported skill id %d\n", skill);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -512,7 +511,6 @@ int SkillStatusChangeTable(int skill)
|
|||||||
else
|
else
|
||||||
if (sk >= HM_SKILLBASE) sk = skill - HM_SKILLBASE + SC_HM_BASE;
|
if (sk >= HM_SKILLBASE) sk = skill - HM_SKILLBASE + SC_HM_BASE;
|
||||||
if (sk < 0 || sk >= MAX_SKILL) {
|
if (sk < 0 || sk >= MAX_SKILL) {
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("add_sc: Unsupported skill id %d\n", skill);
|
ShowError("add_sc: Unsupported skill id %d\n", skill);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -4336,7 +4334,7 @@ void status_set_viewdata(struct block_list *bl, int class_)
|
|||||||
sd->vd.sex = sd->status.sex;
|
sd->vd.sex = sd->status.sex;
|
||||||
} else if (vd)
|
} else if (vd)
|
||||||
memcpy(&sd->vd, vd, sizeof(struct view_data));
|
memcpy(&sd->vd, vd, sizeof(struct view_data));
|
||||||
else if (battle_config.error_log)
|
else
|
||||||
ShowError("status_set_viewdata (PC): No view data for class %d\n", class_);
|
ShowError("status_set_viewdata (PC): No view data for class %d\n", class_);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -4345,7 +4343,7 @@ void status_set_viewdata(struct block_list *bl, int class_)
|
|||||||
TBL_MOB* md = (TBL_MOB*)bl;
|
TBL_MOB* md = (TBL_MOB*)bl;
|
||||||
if (vd)
|
if (vd)
|
||||||
md->vd = vd;
|
md->vd = vd;
|
||||||
else if (battle_config.error_log)
|
else
|
||||||
ShowError("status_set_viewdata (MOB): No view data for class %d\n", class_);
|
ShowError("status_set_viewdata (MOB): No view data for class %d\n", class_);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -4362,7 +4360,7 @@ void status_set_viewdata(struct block_list *bl, int class_)
|
|||||||
pd->vd.head_bottom = pd->pet.equip;
|
pd->vd.head_bottom = pd->pet.equip;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (battle_config.error_log)
|
} else
|
||||||
ShowError("status_set_viewdata (PET): No view data for class %d\n", class_);
|
ShowError("status_set_viewdata (PET): No view data for class %d\n", class_);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -4371,7 +4369,7 @@ void status_set_viewdata(struct block_list *bl, int class_)
|
|||||||
TBL_NPC* nd = (TBL_NPC*)bl;
|
TBL_NPC* nd = (TBL_NPC*)bl;
|
||||||
if (vd)
|
if (vd)
|
||||||
nd->vd = vd;
|
nd->vd = vd;
|
||||||
else if (battle_config.error_log)
|
else
|
||||||
ShowError("status_set_viewdata (NPC): No view data for class %d\n", class_);
|
ShowError("status_set_viewdata (NPC): No view data for class %d\n", class_);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -4380,7 +4378,7 @@ void status_set_viewdata(struct block_list *bl, int class_)
|
|||||||
struct homun_data *hd = (struct homun_data*)bl;
|
struct homun_data *hd = (struct homun_data*)bl;
|
||||||
if (vd)
|
if (vd)
|
||||||
hd->vd = vd;
|
hd->vd = vd;
|
||||||
else if (battle_config.error_log)
|
else
|
||||||
ShowError("status_set_viewdata (HOMUNCULUS): No view data for class %d\n", class_);
|
ShowError("status_set_viewdata (HOMUNCULUS): No view data for class %d\n", class_);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -4606,7 +4604,6 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
|
|||||||
|
|
||||||
if( type < 0 || type >= SC_MAX )
|
if( type < 0 || type >= SC_MAX )
|
||||||
{
|
{
|
||||||
if( battle_config.error_log )
|
|
||||||
ShowError("status_change_start: invalid status change (%d)!\n", type);
|
ShowError("status_change_start: invalid status change (%d)!\n", type);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -5874,7 +5871,6 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
|
|||||||
default:
|
default:
|
||||||
if( calc_flag == SCB_NONE && StatusSkillChangeTable[type] == 0 && StatusIconChangeTable[type] == 0 )
|
if( calc_flag == SCB_NONE && StatusSkillChangeTable[type] == 0 && StatusIconChangeTable[type] == 0 )
|
||||||
{ //Status change with no calc, no icon, and no skill associated...?
|
{ //Status change with no calc, no icon, and no skill associated...?
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("UnknownStatusChange [%d]\n", type);
|
ShowError("UnknownStatusChange [%d]\n", type);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -6628,7 +6624,6 @@ int kaahi_heal_timer(int tid, unsigned int tick, int id, int data)
|
|||||||
if (!sc || !status || data != SC_KAAHI || sc->data[data].timer==-1)
|
if (!sc || !status || data != SC_KAAHI || sc->data[data].timer==-1)
|
||||||
return 0;
|
return 0;
|
||||||
if(sc->data[data].val4 != tid) {
|
if(sc->data[data].val4 != tid) {
|
||||||
if (battle_config.error_log)
|
|
||||||
ShowError("kaahi_heal_timer: Timer mismatch: %d != %d\n", tid, sc->data[data].val4);
|
ShowError("kaahi_heal_timer: Timer mismatch: %d != %d\n", tid, sc->data[data].val4);
|
||||||
sc->data[data].val4=-1;
|
sc->data[data].val4=-1;
|
||||||
return 0;
|
return 0;
|
||||||
@ -6671,7 +6666,6 @@ int status_change_timer(int tid, unsigned int tick, int id, int data)
|
|||||||
|
|
||||||
if( sc->data[type].timer != tid )
|
if( sc->data[type].timer != tid )
|
||||||
{
|
{
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("status_change_timer: Mismatch for type %d: %d != %d (bl id %d)\n",type,tid,sc->data[type].timer, bl->id);
|
ShowError("status_change_timer: Mismatch for type %d: %d != %d (bl id %d)\n",type,tid,sc->data[type].timer, bl->id);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -123,7 +123,6 @@ static int unit_walktoxy_timer(int tid,unsigned int tick,int id,int data)
|
|||||||
if(ud == NULL) return 0;
|
if(ud == NULL) return 0;
|
||||||
|
|
||||||
if(ud->walktimer != tid){
|
if(ud->walktimer != tid){
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("unit_walk_timer mismatch %d != %d\n",ud->walktimer,tid);
|
ShowError("unit_walk_timer mismatch %d != %d\n",ud->walktimer,tid);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -582,19 +581,16 @@ int unit_warp(struct block_list *bl,short m,short x,short y,int type)
|
|||||||
if (x<0 || y<0)
|
if (x<0 || y<0)
|
||||||
{ //Random map position.
|
{ //Random map position.
|
||||||
if (!map_search_freecell(NULL, m, &x, &y, -1, -1, 1)) {
|
if (!map_search_freecell(NULL, m, &x, &y, -1, -1, 1)) {
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowWarning("unit_warp failed. Unit Id:%d/Type:%d, target position map %d (%s) at [%d,%d]\n", bl->id, bl->type, m, map[m].name, x, y);
|
ShowWarning("unit_warp failed. Unit Id:%d/Type:%d, target position map %d (%s) at [%d,%d]\n", bl->id, bl->type, m, map[m].name, x, y);
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
} else if (map_getcell(m,x,y,CELL_CHKNOREACH))
|
} else if (map_getcell(m,x,y,CELL_CHKNOREACH))
|
||||||
{ //Invalid target cell
|
{ //Invalid target cell
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowWarning("unit_warp: Specified non-walkable target cell: %d (%s) at [%d,%d]\n", m, map[m].name, x,y);
|
ShowWarning("unit_warp: Specified non-walkable target cell: %d (%s) at [%d,%d]\n", m, map[m].name, x,y);
|
||||||
|
|
||||||
if (!map_search_freecell(NULL, m, &x, &y, 4, 4, 1))
|
if (!map_search_freecell(NULL, m, &x, &y, 4, 4, 1))
|
||||||
{ //Can't find a nearby cell
|
{ //Can't find a nearby cell
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowWarning("unit_warp failed. Unit Id:%d/Type:%d, target position map %d (%s) at [%d,%d]\n", bl->id, bl->type, m, map[m].name, x, y);
|
ShowWarning("unit_warp failed. Unit Id:%d/Type:%d, target position map %d (%s) at [%d,%d]\n", bl->id, bl->type, m, map[m].name, x, y);
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
@ -1353,7 +1349,6 @@ static int unit_attack_timer_sub(struct block_list* src, int tid, unsigned int t
|
|||||||
if((ud=unit_bl2ud(src))==NULL)
|
if((ud=unit_bl2ud(src))==NULL)
|
||||||
return 0;
|
return 0;
|
||||||
if(ud->attacktimer != tid){
|
if(ud->attacktimer != tid){
|
||||||
if(battle_config.error_log)
|
|
||||||
ShowError("unit_attack_timer %d != %d\n",ud->attacktimer,tid);
|
ShowError("unit_attack_timer %d != %d\n",ud->attacktimer,tid);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user