NPC Menu too long

K4m4r40

New member
Messages
65
Points
0
Github
K4M4R40
Emulator
[Warning] NPC Menu too long! (source:Bre@k Maps / length:10897)
is possible to increase the maximum characters on the menu?

My menu has more than 70 maps.... 
default_dry.png
 

Thx for help.

 
if you increase it will crash your client lol

script.c

Code:
/* menus beyond this length crash the client (see bugreport:6402) */		if( StrBuf->Length(&buf) >= 2047 ) {			struct npc_data * nd = map->id2nd(st->oid);			char* menu;			CREATE(menu, char, 2048);			safestrncpy(menu, StrBuf->Value(&buf), 2047);			ShowWarning("NPC Menu too long! (source:%s / length:%d)n",nd?nd->name:"Unknown",StrBuf->Length(&buf));			clif->scriptmenu(sd, st->oid, menu);			aFree(menu);		} else			clif->scriptmenu(sd, st->oid, StrBuf->Value(&buf));
 
has some way to show the large menu without spending limit?

I'm out of ideas hehe.

 

I thought of something like:
menu"Previous maps ...",return,"map 61",map_61,"map 62",map_62,"map 63",map_63,"map 64",map_64,"map 65",map_65,"map 66",map_66,"map 67",map_67,"map 68",map_68,"map 69",map_69,"map 70",map_70; 
gave a dismal now 
default_laugh.png


 
Last edited by a moderator:
you could use a pagination system, I've seen several scripts using it in order to avoid this problem, you may want to search for some scripts like that, sorry but I don't have any example and my scripting level is not that advanced lol

 
Back
Top