- Modified mob_drop_adjust function to receive unsigned int as initial parameter, should give a bit more room before data overflows.

- Increased range check for Extremity to 2.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6297 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
skotlex 2006-04-26 21:33:07 +00:00
parent d66d94cd80
commit 66cb46e29d
2 changed files with 6 additions and 4 deletions

View File

@ -3066,7 +3066,7 @@ static int mob_makedummymobdb(int class_)
} }
//Adjusts the drop rate of item according to the criteria given. [Skotlex] //Adjusts the drop rate of item according to the criteria given. [Skotlex]
static int mob_drop_adjust(int rate, int rate_adjust, int rate_min, int rate_max) static unsigned int mob_drop_adjust(unsigned int rate, int rate_adjust, unsigned short rate_min, unsigned short rate_max)
{ {
if (battle_config.logarithmic_drops && rate_adjust > 0) //Logarithmic drops equation by Ishizu-Chan if (battle_config.logarithmic_drops && rate_adjust > 0) //Logarithmic drops equation by Ishizu-Chan
//Equation: Droprate(x,y) = x * (5 - log(x)) ^ (ln(y) / ln(5)) //Equation: Droprate(x,y) = x * (5 - log(x)) ^ (ln(y) / ln(5))
@ -3174,7 +3174,8 @@ static int mob_readdb(void)
mob_db_data[class_]->dmotion=atoi(str[29]); mob_db_data[class_]->dmotion=atoi(str[29]);
for(i=0;i<10;i++){ // 8 -> 10 Lupus for(i=0;i<10;i++){ // 8 -> 10 Lupus
int rate = 0,rate_adjust,type,ratemin,ratemax; int rate = 0,rate_adjust,type;
unsigned short ratemin,ratemax;
struct item_data *id; struct item_data *id;
mob_db_data[class_]->dropitem[i].nameid=atoi(str[30+i*2]); mob_db_data[class_]->dropitem[i].nameid=atoi(str[30+i*2]);
if (!mob_db_data[class_]->dropitem[i].nameid) { if (!mob_db_data[class_]->dropitem[i].nameid) {
@ -3800,7 +3801,8 @@ static int mob_read_sqldb(void)
mob_db_data[class_]->dmotion = TO_INT(29); mob_db_data[class_]->dmotion = TO_INT(29);
for (i = 0; i < 10; i++){ // 8 -> 10 Lupus for (i = 0; i < 10; i++){ // 8 -> 10 Lupus
int rate = 0, rate_adjust, type, ratemin, ratemax; int rate = 0, rate_adjust, type;
unsigned short ratemin, ratemax;
struct item_data *id; struct item_data *id;
mob_db_data[class_]->dropitem[i].nameid=TO_INT(30+i*2); mob_db_data[class_]->dropitem[i].nameid=TO_INT(30+i*2);
if (!mob_db_data[class_]->dropitem[i].nameid) { if (!mob_db_data[class_]->dropitem[i].nameid) {

View File

@ -2644,7 +2644,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl,int s
if (sc->data[SC_COMBO].timer != -1) //This is one is here to make combo end even if skill failed. if (sc->data[SC_COMBO].timer != -1) //This is one is here to make combo end even if skill failed.
status_change_end(src,SC_COMBO,-1); status_change_end(src,SC_COMBO,-1);
} }
if(!check_distance_bl(src, bl, 1)) { //Need to move to target. if(!check_distance_bl(src, bl, 2)) { //Need to move to target.
struct unit_data *ud; struct unit_data *ud;
int dx,dy; int dx,dy;