Corrected some MAX_SEARCH results (fixes #1345)

* The count was already being capped by itemdb_searchname_array() so the check was never hit.
* Adjusted the return message to match the corrected result.
This commit is contained in:
aleos89
2016-06-16 13:46:15 -04:00
parent abf939c559
commit 604e805c03
11 changed files with 20 additions and 27 deletions

View File

@@ -279,7 +279,7 @@
266: Some of your items cannot be vended and were removed from the shop.
267: '%s' designated maps reset.
268: Reloaded the Message of the Day.
269: Displaying first %d out of %d matches
269: Displaying first %d matches
//@me output format
270: * :%s %s: *
271: You can't drop items on this map.

View File

@@ -283,7 +283,7 @@
266: 你的某些物品不能被出售,它將從你的商店中被取消掉
267: '%s' 該地圖被重置
268: 重新載入今天的訊息
269: 顯示 %d 分之 %d 關聯
269: 顯示 %d 關聯
//@me output format
270: * :%s %s: *
271: 在這張地圖你無法丟棄物品

View File

@@ -283,7 +283,7 @@
266: Certains de vos objets ne peuvent pas être vendus et ont été supprimés du magasin.
267: Carte '%s' réinitialisée.
268: Re-lancement du message du jour.
269: Affichage des premiers %d parmis %d trouvés
269: Affichage des %d premiers résultats trouvés
//@me output format
270: * :%s %s: *
271: Vous ne pouvez pas déposer d'objets sur cette carte.

View File

@@ -282,7 +282,7 @@
266: Manche Items können nicht verkauft werden und werden aus dem Shop entfernt.
267: '%s' bezeichnetete Maps resettet.
268: Läd die Nachrichten vom Tag neu.
269: Zeigt erst %d von %d treffern
269: Zeigt erst %d treffern
//@me output format
270: * :%s %s: *
271: Du kannst auf dieser Map keine Items droppen.

View File

@@ -279,7 +279,7 @@
266: Beberapa item tidak dapat ditransaksikan dan telah dikeluarkan dari toko.
267: '%s' map yang dipilih sudah diatur ulang.
268: 'Pesan Hari Ini' sudah dimuat ulang.
269: Menampilkan hasil %d dari %d
269: Menampilkan hasil %d
//@me format keluaran
270: * :%s %s: *
271: Kamu tidak bisa membuang item di map ini.

View File

@@ -288,7 +288,7 @@
266: Alguns de seus itens não podem ser vendidos e foram removidos de sua venda.
267: '%s' mapas designados redefinidos.
268: Recarregada Mensagem do Dia.
269: Exibindo o primeiro %d de %d resultados
269: Exibindo o primeiro %d resultados
//Formato de saída do @me
270: * :%s %s: *
271: Você não pode derrubar itens neste mapa

View File

@@ -281,7 +281,7 @@
266: Некоторые из ваших товаров не могут быть проданы, поэтому они удалены из магазина.
267: '%s' обозначеных карт сброшено.
268: Сообщение дня перезагружено.
269: Показаны первые %d из %d результатов
269: Показаны первые %d результатов
// Сообщение команды @me
270: * :%s %s: *
271: Вы не можете выбрасывать предметы на этой локации.

View File

@@ -283,7 +283,7 @@
266: Algunos de tus objetos se han retirado de la tienda porque no pueden venderse.
267: Se han reiniciado los mapas designados a '%s'.
268: Has actualizado el mensaje del día.
269: Se muestran %d de un total de %d resultados.
269: Se muestran %d resultados
//Formato de @me
270: * :%s %s: *
271: No puedes tirar objetos al suelo en este mapa.

View File

@@ -283,7 +283,7 @@
266: <20><>÷<EFBFBD>§ Item ¢<>§¤<C2A7>³ה<C2B3>ט<EFBFBD><D798><EFBFBD><EFBFBD><EFBFBD>¶¹<C2B6><C2B9><EFBFBD>µ<EFBFBD>י§<D799>י<EFBFBD>¹¢<C2B9><C2A2>¢<EFBFBD>§ה´י <20><><EFBFBD>³<EFBFBD>¹<EFBFBD><C2B9><EFBFBD><EFBFBD>¨<EFBFBD><C2A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD>י§<D799>י<EFBFBD>¹.
267: '%s' designated maps reset.
268: ¢י<C2A2>¤<EFBFBD><C2A4><EFBFBD>»<EFBFBD><C2BB>¨<EFBFBD><C2A8><EFBFBD>¹ ה´י<D799><C2B6>ג<EFBFBD><D792>´ד<C2B4><D793>טא<D798><D790><EFBFBD>÷<EFBFBD>י<EFBFBD><D799>ב<EFBFBD>י<EFBFBD>.
269: ב<>´§¼<C2A7><C2BC><EFBFBD><EFBFBD>¤י¹<D799><C2B9> %d <20><>¹´<C2B9>÷ב<C3B7><D791>¨<EFBFBD><C2A8>·<EFBFBD>י§<D799><C2A7>´ %d ·<>ט¾÷
269: ב<>´§¼<C2A7><C2BC><EFBFBD><EFBFBD>¤י¹<D799><C2B9> %d ·<>ט¾÷
//@me output format
270: * :%s %s: *
271: ¤<>³ה<C2B3>ט<EFBFBD><D798><EFBFBD><EFBFBD><EFBFBD>¶ג<C2B6>¹ item <20>§¾<C2A7>י¹ד¹ב¼¹·<C2B9>ט¹<D798>יה´י.

View File

@@ -3569,10 +3569,9 @@ ACMD_FUNC(idsearch)
sprintf(atcmd_output, msg_txt(sd,77), item_name); // The reference result of '%s' (name: id):
clif_displaymessage(fd, atcmd_output);
match = itemdb_searchname_array(item_array, MAX_SEARCH, item_name);
if (match > MAX_SEARCH) {
sprintf(atcmd_output, msg_txt(sd,269), MAX_SEARCH, match);
if (match == MAX_SEARCH) {
sprintf(atcmd_output, msg_txt(sd,269), MAX_SEARCH); // Displaying first %d matches
clif_displaymessage(fd, atcmd_output);
match = MAX_SEARCH;
}
for(i = 0; i < match; i++) {
sprintf(atcmd_output, msg_txt(sd,78), item_array[i]->jname, item_array[i]->nameid); // %s: %d
@@ -7071,10 +7070,9 @@ ACMD_FUNC(mobinfo)
return -1;
}
if (count > MAX_SEARCH) {
sprintf(atcmd_output, msg_txt(sd,269), MAX_SEARCH, count);
if (count == MAX_SEARCH) {
sprintf(atcmd_output, msg_txt(sd,269), MAX_SEARCH); // Displaying first %d matches
clif_displaymessage(fd, atcmd_output);
count = MAX_SEARCH;
}
for (k = 0; k < count; k++) {
unsigned int j,base_exp,job_exp;
@@ -7594,10 +7592,9 @@ ACMD_FUNC(iteminfo)
return -1;
}
if (count > MAX_SEARCH) {
sprintf(atcmd_output, msg_txt(sd,269), MAX_SEARCH, count); // Displaying first %d out of %d matches
if (count == MAX_SEARCH) {
sprintf(atcmd_output, msg_txt(sd,269), MAX_SEARCH); // Displaying first %d matches
clif_displaymessage(fd, atcmd_output);
count = MAX_SEARCH;
}
for (i = 0; i < count; i++) {
struct item_data * item_data = item_array[i];
@@ -7646,10 +7643,9 @@ ACMD_FUNC(whodrops)
return -1;
}
if (count > MAX_SEARCH) {
sprintf(atcmd_output, msg_txt(sd,269), MAX_SEARCH, count); // Displaying first %d out of %d matches
if (count == MAX_SEARCH) {
sprintf(atcmd_output, msg_txt(sd,269), MAX_SEARCH); // Displaying first %d matches
clif_displaymessage(fd, atcmd_output);
count = MAX_SEARCH;
}
for (i = 0; i < count; i++) {
item_data = item_array[i];
@@ -7708,10 +7704,9 @@ ACMD_FUNC(whereis)
return -1;
}
if (count > MAX_SEARCH) {
sprintf(atcmd_output, msg_txt(sd,269), MAX_SEARCH, count);
if (count == MAX_SEARCH) {
sprintf(atcmd_output, msg_txt(sd,269), MAX_SEARCH); // Displaying first %d matches
clif_displaymessage(fd, atcmd_output);
count = MAX_SEARCH;
}
for (k = 0; k < count; k++) {
struct mob_db *mob = mob_array[k];

View File

@@ -16581,10 +16581,8 @@ BUILDIN_FUNC(searchitem)
if ((items[0] = itemdb_exists(atoi(itemname))))
count = 1;
else {
else
count = itemdb_searchname_array(items, ARRAYLENGTH(items), itemname);
if (count > MAX_SEARCH) count = MAX_SEARCH;
}
if (!count) {
script_pushint(st, 0);