- Corrected SC_INTRAVISION not starting.

- Small cleanups (line terminators, indenting)
- Fixed crash when attempting to read a Label as a string on a script (thanks to End of Exam)
- Fixed possible crash when changing a chat-room's owner (thanks to End of Exam)


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8639 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
skotlex 2006-09-05 19:49:38 +00:00
parent d0563b1951
commit 4e9c745bdf
9 changed files with 58 additions and 53 deletions

View File

@ -4,6 +4,11 @@ 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.
2006/09/05 2006/09/05
* Corrected SC_INTRAVISION not starting. [Skotlex]
* Fixed crash when attempting to read a Label as a string on a script
(thanks to End of Exam) [Skotlex]
* Fixed possible crash when changing a chat-room's owner (thanks to End of
Exam) [Skotlex]
* Fixed dispell removing SC_NOCHAT [Skotlex] * Fixed dispell removing SC_NOCHAT [Skotlex]
* Small fix which should correct skill_attack damaging hidden characters * Small fix which should correct skill_attack damaging hidden characters
when it shouldn't. [Skotlex] when it shouldn't. [Skotlex]

View File

@ -145,16 +145,18 @@ int chat_leavechat(struct map_session_data *sd)
pc_setchatid(sd,0); pc_setchatid(sd,0);
if(cd->users == 0 && (*cd->owner)->type==BL_PC){ if(cd->users == 0 && (*cd->owner)->type==BL_PC){
// 全員居なくなった&PCのチャットなので消す //Delete empty chatroom
clif_clearchat(cd,0); clif_clearchat(cd,0);
map_delobject(cd->bl.id); // freeまでしてくれる map_delobject(cd->bl.id);
} else { } else {
for(i=leavechar;i < cd->users;i++) for(i=leavechar;i < cd->users;i++)
cd->usersd[i] = cd->usersd[i+1]; cd->usersd[i] = cd->usersd[i+1];
if(leavechar==0 && (*cd->owner)->type==BL_PC){ if(leavechar==0 && (*cd->owner)->type==BL_PC){
// PCのチャットなので所有者が抜けたので位置変更 //Adjust Chat location after owner has been changed.
map_delblock( &cd->bl );
cd->bl.x=cd->usersd[0]->bl.x; cd->bl.x=cd->usersd[0]->bl.x;
cd->bl.y=cd->usersd[0]->bl.y; cd->bl.y=cd->usersd[0]->bl.y;
map_addblock( &cd->bl );
} }
clif_dispchat(cd,0); clif_dispchat(cd,0);
} }
@ -197,9 +199,10 @@ int chat_changechatowner(struct map_session_data *sd,char *nextownername)
cd->usersd[0] = cd->usersd[nextowner]; cd->usersd[0] = cd->usersd[nextowner];
cd->usersd[nextowner] = tmp_sd; cd->usersd[nextowner] = tmp_sd;
// 新しい所有者の位置へ変更 map_delblock( &cd->bl );
cd->bl.x=cd->usersd[0]->bl.x; cd->bl.x=cd->usersd[0]->bl.x;
cd->bl.y=cd->usersd[0]->bl.y; cd->bl.y=cd->usersd[0]->bl.y;
map_addblock( &cd->bl );
// <20>Ä“x•\ަ // <20>Ä“x•\ަ
clif_dispchat(cd,0); clif_dispchat(cd,0);

View File

@ -11708,7 +11708,7 @@ int clif_parse(int fd) {
return 0; // まだ1パケット分データが揃ってない return 0; // まだ1パケット分データが揃ってない
#if DUMP_ALL_PACKETS #if DUMP_ALL_PACKETS
dump = 1; {
int i; int i;
FILE *fp; FILE *fp;
char packet_txt[256] = "save/packet.txt"; char packet_txt[256] = "save/packet.txt";
@ -11739,6 +11739,7 @@ int clif_parse(int fd) {
fprintf(fp, "\n\n"); fprintf(fp, "\n\n");
fclose(fp); fclose(fp);
} }
}
#endif #endif
if (sd && sd->state.auth == 1 && sd->state.waitingdisconnect == 1) { // 切断待ちの場合パケットを処理しない if (sd && sd->state.auth == 1 && sd->state.waitingdisconnect == 1) { // 切断待ちの場合パケットを処理しない

View File

@ -52,7 +52,6 @@ static int npc_mob=0;
static int npc_delay_mob=0; static int npc_delay_mob=0;
static int npc_cache_mob=0; static int npc_cache_mob=0;
char *current_file = NULL; char *current_file = NULL;
//int dummy_npc_id=0;
int npc_get_new_npc_id(void){ return npc_id++; } int npc_get_new_npc_id(void){ return npc_id++; }
static struct dbt *ev_db; static struct dbt *ev_db;

View File

@ -81,8 +81,6 @@ int npc_unload(struct npc_data *nd);
int npc_reload(void); int npc_reload(void);
int npc_script_event(TBL_PC* sd, int type); int npc_script_event(TBL_PC* sd, int type);
extern int dummy_npc_id;
extern char *current_file; extern char *current_file;
struct npc_data *fake_nd; struct npc_data *fake_nd;

View File

@ -559,8 +559,7 @@ unsigned char* parse_simpleexpr(unsigned char *p)
int c,l; int c,l;
char *p2; char *p2;
// label , register , function etc // label , register , function etc
//From what I read, jA figured a better way to handle empty parenthesis '()' if(skip_word(p)==p){
if(skip_word(p)==p/* && !(*p==')' && p[-1]=='(')*/){
disp_error_message("unexpected character",p); disp_error_message("unexpected character",p);
exit(1); exit(1);
} }
@ -1494,7 +1493,6 @@ static void read_constdb(void)
type=0; type=0;
if(sscanf(line,"%[A-Za-z0-9_],%[0-9xXA-Fa-f],%d",name,val,&type)>=2 || if(sscanf(line,"%[A-Za-z0-9_],%[0-9xXA-Fa-f],%d",name,val,&type)>=2 ||
sscanf(line,"%[A-Za-z0-9_] %[0-9xXA-Fa-f] %d",name,val,&type)>=2){ sscanf(line,"%[A-Za-z0-9_] %[0-9xXA-Fa-f] %d",name,val,&type)>=2){
for(i=0;name[i];i++) for(i=0;name[i];i++)
name[i]=tolower(name[i]); name[i]=tolower(name[i]);
n=add_str((const unsigned char *) name); n=add_str((const unsigned char *) name);
@ -1929,12 +1927,13 @@ char* conv_str(struct script_state *st,struct script_data *data)
snprintf(buf,ITEM_NAME_LENGTH, "%d",data->u.num); snprintf(buf,ITEM_NAME_LENGTH, "%d",data->u.num);
data->type=C_STR; data->type=C_STR;
data->u.str=buf; data->u.str=buf;
#if 1 } else if(data->type==C_POS) {
// Protect form crashes by passing labels to string-expected args [jA2200]
data->type = C_CONSTSTR;
data->u.str = "** SCRIPT ERROR **";
} else if(data->type==C_NAME){ } else if(data->type==C_NAME){
// テンポラリ。本来無いはず
data->type=C_CONSTSTR; data->type=C_CONSTSTR;
data->u.str=str_buf+str_data[data->u.num].str; data->u.str=str_buf+str_data[data->u.num].str;
#endif
} }
return data->u.str; return data->u.str;
} }
@ -2791,7 +2790,6 @@ int mapreg_setreg(int num,int val)
} }
} }
#endif #endif
// else
} else { // [zBuffer] } else { // [zBuffer]
#if !defined(TXT_ONLY) && defined(MAPREGSQL) #if !defined(TXT_ONLY) && defined(MAPREGSQL)
if(name[1] != '@') { // Remove from database because it is unused. if(name[1] != '@') { // Remove from database because it is unused.
@ -11715,7 +11713,6 @@ int buildin_axtoi(struct script_state *st)
return 0; return 0;
} }
// [zBuffer] List of player cont commands ---> // [zBuffer] List of player cont commands --->
int buildin_rid2name(struct script_state *st){ int buildin_rid2name(struct script_state *st){
struct block_list *bl = NULL; struct block_list *bl = NULL;

View File

@ -35,7 +35,7 @@ struct script_data {
int num; int num;
char *str; char *str;
} u; } u;
struct linkdb_node** ref; // リファレンス struct linkdb_node** ref;
}; };
// Moved defsp from script_state to script_stack since // Moved defsp from script_state to script_stack since

View File

@ -5561,9 +5561,11 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
if (map[bl->m].flag.pvp) if (map[bl->m].flag.pvp)
tick /=2; tick /=2;
break; break;
case SC_INTRAVISION:
case SC_ARMOR_ELEMENT: case SC_ARMOR_ELEMENT:
break; // It just change the armor element of the player (used by battle_attr_fix) //Place here SCs that have no SCB_* data, no skill associated, no ICON
// So it has no SCB and no skill associated (used by potion scripts) //associated, and yet are not wrong/unknown. [Skotlex]
break;
default: default:
if (calc_flag == SCB_NONE && if (calc_flag == SCB_NONE &&
StatusSkillChangeTable[type]==0 && StatusSkillChangeTable[type]==0 &&