Fixed mail script command (#6294)

Fixes #5970
Broken since e5c22b3

Thanks to @roSBK
This commit is contained in:
Lemongrass3110 2021-10-07 12:41:29 +02:00 committed by GitHub
parent c4df5caa00
commit fe5c5d8869
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);