summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-12-29 21:10:37 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-12-29 21:10:37 +0000
commit08236cbfa812ac2348f3f3235e39d316ed781240 (patch)
tree4fc193ed00e0e591bfb8290f649430cfa4400f25 /src/map/pc.c
parent318c755672a348465481047a2642a93db4c5c65e (diff)
downloadhercules-08236cbfa812ac2348f3f3235e39d316ed781240.tar.gz
hercules-08236cbfa812ac2348f3f3235e39d316ed781240.tar.bz2
hercules-08236cbfa812ac2348f3f3235e39d316ed781240.tar.xz
hercules-08236cbfa812ac2348f3f3235e39d316ed781240.zip
Fixed broken card insert code (bugreport:2606).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13421 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 82a3fcff8..c2fa49e72 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -2746,6 +2746,7 @@ int pc_skill(TBL_PC* sd, int id, int level, int flag)
int pc_insert_card(struct map_session_data* sd, int idx_card, int idx_equip)
{
int i;
+ int nameid;
nullpo_retr(0, sd);
@@ -2776,13 +2777,16 @@ int pc_insert_card(struct map_session_data* sd, int idx_card, int idx_equip)
if( i == sd->inventory_data[idx_equip]->slot )
return 0; // no free slots
+ // remember the card id to insert
+ nameid = sd->status.inventory[idx_card].nameid;
+
if( pc_delitem(sd,idx_card,1,1) == 1 )
{// failed
clif_insert_card(sd,idx_equip,idx_card,1);
}
else
{// success
- sd->status.inventory[idx_equip].card[i] = sd->status.inventory[idx_card].nameid;
+ sd->status.inventory[idx_equip].card[i] = nameid;
clif_insert_card(sd,idx_equip,idx_card,0);
}