summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-11-19 06:08:49 +0000
committerLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-11-19 06:08:49 +0000
commit8d524301c8b44fc2dcb10712886bb24e8ea0f7b4 (patch)
tree2ef6d816f5d4d43fcbf8a87510ee51f241879b4e /src/map/clif.c
parent6de5cb578078dfafbf1da489712304f43144bd7d (diff)
downloadhercules-8d524301c8b44fc2dcb10712886bb24e8ea0f7b4.tar.gz
hercules-8d524301c8b44fc2dcb10712886bb24e8ea0f7b4.tar.bz2
hercules-8d524301c8b44fc2dcb10712886bb24e8ea0f7b4.tar.xz
hercules-8d524301c8b44fc2dcb10712886bb24e8ea0f7b4.zip
* Hack protection from packet monkeys in clif_parse_NpcSelectMenu.
modified Changelog-Trunk.txt modified src/map/clif.c modified src/map/map.h modified src/map/script.c git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9261 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 293242c41..28e3f0ecd 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -10059,10 +10059,17 @@ void clif_parse_WeaponRefine(int fd, struct map_session_data *sd) {
*/
void clif_parse_NpcSelectMenu(int fd,struct map_session_data *sd)
{
+ unsigned char select;
RFIFOHEAD(fd);
- sd->npc_menu=RFIFOB(fd,6);
- npc_scriptcont(sd,RFIFOL(fd,2));
+ select = RFIFOB(fd,6);
+ if((select > sd->max_menu && select != 0xff) || !select){
+ ShowWarning("Hack on NPC Select Menu: %s (AID: %d)!\n",sd->status.name,sd->bl.id);
+ clif_GM_kick(sd,sd,0);
+ } else {
+ sd->npc_menu=select;
+ npc_scriptcont(sd,RFIFOL(fd,2));
+ }
}
/*==========================================