summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorIbrahim Zidan <brahem@aotsw.com>2019-04-08 22:14:16 +0200
committerIbrahim Zidan <brahem@aotsw.com>2019-04-08 23:37:17 +0200
commit9e934f3608a4a67667573514909911130493e174 (patch)
tree7ae7346a08f389c5d48413a1fbd473808b169426 /src/map/atcommand.c
parentab81d4012eac5c2c00c485971fc9b89bf69761be (diff)
downloadhercules-9e934f3608a4a67667573514909911130493e174.tar.gz
hercules-9e934f3608a4a67667573514909911130493e174.tar.bz2
hercules-9e934f3608a4a67667573514909911130493e174.tar.xz
hercules-9e934f3608a4a67667573514909911130493e174.zip
Fix an issue with named/brewed/forged items getting saved with the wrong character id
The isue was triggered by the refactoring of old undocumented code that relied on the overflow behavior during assignment from int32 to int16 and from uint16 to int16, and by a subsequent clamping to SMALLINT range operated by the SQL server. Credits: Haru <haru@dotalux.com> Fixes #2409 Signed-off-by: Ibrahim Zidan <brahem@aotsw.com>
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index a9bbff7bd..b670d64dc 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -5599,9 +5599,9 @@ static void atcommand_getring(struct map_session_data *sd)
memset(&item_tmp, 0, sizeof(item_tmp));
item_tmp.nameid = item_id;
item_tmp.identify = 1;
- item_tmp.card[0] = 255;
- item_tmp.card[2] = sd->status.partner_id;
- item_tmp.card[3] = sd->status.partner_id >> 16;
+ item_tmp.card[0] = CARD0_FORGE;
+ item_tmp.card[2] = GetWord(sd->status.partner_id, 0);
+ item_tmp.card[3] = GetWord(sd->status.partner_id, 1);
if((flag = pc->additem(sd,&item_tmp,1,LOG_TYPE_COMMAND))) {
clif->additem(sd,0,0,flag);