Fixed an issue with mail (#7518)

* mail should accept card with ID 0 (no card) when the parameter card is provided
This commit is contained in:
Atemo 2022-12-29 23:36:55 +01:00 committed by GitHub
parent fa0253342a
commit d0b51d91a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25778,7 +25778,7 @@ BUILDIN_FUNC(mail){
for( k = 0; k < num_items && start < end; k++, start++ ){
msg.item[k].card[i] = (t_itemid)get_val2_num( st, reference_uid( id, start ), reference_getref( data ) );
if( !item_db.exists(msg.item[k].card[i]) ){
if( msg.item[k].card[i] > 0 && !item_db.exists(msg.item[k].card[i]) ){
ShowError( "buildin_mail: invalid card id %u.\n", msg.item[k].card[i] );
return SCRIPT_CMD_FAILURE;
}