* Added crash check for Ice Wall
- reduce mob_data->size variable to 1 bytes - change from if-else to switch statements in buildin_strmobinfo git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@1020 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
d530bc485d
commit
d96cc5a331
@ -1,4 +1,9 @@
|
||||
Date Added
|
||||
02/02
|
||||
* Added crash check for Ice Wall [celest]
|
||||
* Added some optimisations by Ilpalazzo-sama [celest]
|
||||
- reduce mob_data->size variable to 1 bytes
|
||||
- change from if-else to switch statements in buildin_strmobinfo
|
||||
|
||||
01/31
|
||||
* Fixed a typo in Pressure causing it to deduct sp from the caster, and remove
|
||||
|
@ -3887,7 +3887,7 @@ int clif_clearchar_skillunit(struct skill_unit *unit,int fd)
|
||||
WFIFOW(fd, 0)=0x120;
|
||||
WFIFOL(fd, 2)=unit->bl.id;
|
||||
WFIFOSET(fd,packet_len_table[0x120]);
|
||||
if(unit->group->skill_id == WZ_ICEWALL)
|
||||
if(unit->group && unit->group->skill_id == WZ_ICEWALL)
|
||||
clif_set0192(fd,unit->bl.m,unit->bl.x,unit->bl.y,unit->val2);
|
||||
|
||||
return 0;
|
||||
|
@ -456,7 +456,7 @@ struct mob_data {
|
||||
struct skill_unit_group skillunit[MAX_MOBSKILLUNITGROUP];
|
||||
struct skill_unit_group_tickset skillunittick[MAX_SKILLUNITGROUPTICKSET];
|
||||
char npc_event[50];
|
||||
short size;
|
||||
unsigned char size;
|
||||
int owner;
|
||||
};
|
||||
struct pet_data {
|
||||
|
@ -5550,37 +5550,46 @@ int buildin_strmobinfo(struct script_state *st)
|
||||
int num=conv_num(st,& (st->stack->stack_data[st->start+2]));
|
||||
int class_=conv_num(st,& (st->stack->stack_data[st->start+3]));
|
||||
|
||||
if(num<=0 || num>=8 || (class_>=0 && class_<=1000) || class_ >2000)
|
||||
if((class_>=0 && class_<=1000) || class_ >2000)
|
||||
return 0;
|
||||
|
||||
if(num==1) {
|
||||
char *buf;
|
||||
buf=aCallocA(24, 1);
|
||||
// buf=mob_db[class_].name;
|
||||
switch (num) {
|
||||
case 1:
|
||||
{
|
||||
char *buf;
|
||||
buf=aCallocA(24, 1);
|
||||
// buf=mob_db[class_].name;
|
||||
// for string assignments you would need to go for c++ [Shinomori]
|
||||
strcpy(buf,mob_db[class_].name);
|
||||
push_str(st->stack,C_STR,buf);
|
||||
return 0;
|
||||
}
|
||||
else if(num==2) {
|
||||
char *buf;
|
||||
buf=aCallocA(24, 1);
|
||||
// buf=mob_db[class_].jname;
|
||||
strcpy(buf,mob_db[class_].name);
|
||||
push_str(st->stack,C_STR,buf);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
char *buf;
|
||||
buf=aCallocA(24, 1);
|
||||
// buf=mob_db[class_].jname;
|
||||
// for string assignments you would need to go for c++ [Shinomori]
|
||||
strcpy(buf,mob_db[class_].jname);
|
||||
push_str(st->stack,C_STR,buf);
|
||||
return 0;
|
||||
}
|
||||
else if(num==3)
|
||||
strcpy(buf,mob_db[class_].jname);
|
||||
push_str(st->stack,C_STR,buf);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
push_val(st->stack,C_INT,mob_db[class_].lv);
|
||||
else if(num==4)
|
||||
break;
|
||||
case 4:
|
||||
push_val(st->stack,C_INT,mob_db[class_].max_hp);
|
||||
else if(num==5)
|
||||
break;
|
||||
case 5:
|
||||
push_val(st->stack,C_INT,mob_db[class_].max_sp);
|
||||
else if(num==6)
|
||||
break;
|
||||
case 6:
|
||||
push_val(st->stack,C_INT,mob_db[class_].base_exp);
|
||||
else if(num==7)
|
||||
break;
|
||||
case 7:
|
||||
push_val(st->stack,C_INT,mob_db[class_].job_exp);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user