瀏覽代碼

Fixed an issue with mail (#7518)

* mail should accept card with ID 0 (no card) when the parameter card is provided
Atemo 2 年之前
父節點
當前提交
d0b51d91a0
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/map/script.cpp

+ 1 - 1
src/map/script.cpp

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