summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2019-05-08 23:48:48 +0300
committerAndrei Karas <akaras@inbox.ru>2019-06-02 00:23:24 +0300
commit62ee0d94b98493e60d41c8a5a3ec27a7246a21e9 (patch)
treead84b668d993e81b1a0f271ce60c1b8aa661a1a9
parente7e25d4030ddd4b5a6e48af3f2dc48dcf6039570 (diff)
downloadhercules-62ee0d94b98493e60d41c8a5a3ec27a7246a21e9.tar.gz
hercules-62ee0d94b98493e60d41c8a5a3ec27a7246a21e9.tar.bz2
hercules-62ee0d94b98493e60d41c8a5a3ec27a7246a21e9.tar.xz
hercules-62ee0d94b98493e60d41c8a5a3ec27a7246a21e9.zip
Add define MAX_HOTKEYS_DB for max stored hotkeys in db
For new RE clients it's double of MAX_HOTKEYS
-rw-r--r--src/char/char.c2
-rw-r--r--src/common/mmo.h8
2 files changed, 8 insertions, 2 deletions
diff --git a/src/char/char.c b/src/char/char.c
index 44225ecb5..81856a25d 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -1415,7 +1415,7 @@ static int char_mmo_char_fromsql(int char_id, struct mmo_charstatus *p, bool loa
while( SQL_SUCCESS == SQL->StmtNextRow(stmt) )
{
- if( hotkey_num >= 0 && hotkey_num < MAX_HOTKEYS )
+ if( hotkey_num >= 0 && hotkey_num < MAX_HOTKEYS_DB )
memcpy(&p->hotkeys[hotkey_num], &tmp_hotkey, sizeof(tmp_hotkey));
else
ShowWarning("chr->mmo_char_fromsql: ignoring invalid hotkey (hotkey=%d,type=%u,id=%u,lv=%u) of character %s (AID=%d,CID=%d)\n", hotkey_num, tmp_hotkey.type, tmp_hotkey.id, tmp_hotkey.lv, p->name, p->account_id, p->char_id);
diff --git a/src/common/mmo.h b/src/common/mmo.h
index eb74d62b3..c62fd31d0 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -151,6 +151,12 @@
#endif // 20090603
#endif // 20070227
+#if PACKETVER_RE_NUM >= 20190508
+#define MAX_HOTKEYS_DB ((MAX_HOTKEYS) * 2)
+#else
+#define MAX_HOTKEYS_DB MAX_HOTKEYS
+#endif
+
#if PACKETVER >= 20150805 /* Cart Decoration */
#define CART_DECORATION
#define MAX_CARTDECORATION_CARTS 3 // Currently there are 3 Carts available in kRO. [Frost]
@@ -732,7 +738,7 @@ struct mmo_charstatus {
struct s_friend friends[MAX_FRIENDS]; //New friend system [Skotlex]
#ifdef HOTKEY_SAVING
- struct hotkey hotkeys[MAX_HOTKEYS];
+ struct hotkey hotkeys[MAX_HOTKEYS_DB];
#endif
bool show_equip;
bool allow_party;