diff --git a/src/map/script.cpp b/src/map/script.cpp index 3a1ca96ea6..4a2ac6f044 100644 --- a/src/map/script.cpp +++ b/src/map/script.cpp @@ -24829,8 +24829,6 @@ BUILDIN_FUNC(mail){ msg.item[i].refine = (char)get_val2_num( st, reference_uid( id, start ), reference_getref( data ) ); - script_removetop(st, -1, 0); - if (!item->flag.no_refine && (item->type == IT_WEAPON || item->type == IT_ARMOR || item->type == IT_SHADOWGEAR)) { if (msg.item[i].refine > MAX_REFINE) msg.item[i].refine = MAX_REFINE; @@ -24857,9 +24855,7 @@ BUILDIN_FUNC(mail){ msg.item[i].bound = (char)get_val2_num( st, reference_uid( id, start ), reference_getref( data ) ); - script_removetop(st, -1, 0); - - if( msg.item[i].bound <= BOUND_NONE || msg.item[i].bound >= BOUND_MAX ){ + if( msg.item[i].bound < BOUND_NONE || msg.item[i].bound >= BOUND_MAX ){ ShowError( "buildin_mail: bound %d for item %u is invalid.\n", msg.item[i].bound, msg.item[i].nameid ); return SCRIPT_CMD_FAILURE; } @@ -24888,11 +24884,11 @@ BUILDIN_FUNC(mail){ } // Random Options - if( !script_hasdata(st,12 + MAX_SLOTS) ){ + if( !script_hasdata(st,11 + MAX_SLOTS) ){ break; } - for( i = 0, j = 12 + MAX_SLOTS; i < MAX_ITEM_RDM_OPT && script_hasdata(st,j) && script_hasdata(st,j + 1) && script_hasdata(st,j + 2); i++, j++ ){ + for( i = 0, j = 11 + MAX_SLOTS; i < MAX_ITEM_RDM_OPT && script_hasdata(st,j) && script_hasdata(st,j + 1) && script_hasdata(st,j + 2); i++, j++ ){ // Option IDs data = script_getdata(st, j);