summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-12-28 23:04:50 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-12-28 23:04:50 +0000
commitf177a358c994824cc937607cf8bb718d47e63de8 (patch)
treec4ceaf1f9c98b8ee8f17b658aef8d4e950cb0469 /src/map/clif.c
parent69d5bbb1866f9dd0570de23ede78240e94a067e9 (diff)
downloadhercules-f177a358c994824cc937607cf8bb718d47e63de8.tar.gz
hercules-f177a358c994824cc937607cf8bb718d47e63de8.tar.bz2
hercules-f177a358c994824cc937607cf8bb718d47e63de8.tar.xz
hercules-f177a358c994824cc937607cf8bb718d47e63de8.zip
Cleaned up code for inserting cards into items.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13418 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index c61ed1366..4031a9243 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -4806,14 +4806,11 @@ int clif_use_card(struct map_session_data *sd,int idx)
if((sd->inventory_data[i]->equip&ep)==0) //Not equippable on this part.
continue;
- if(sd->inventory_data[i]->type==IT_WEAPON && ep==EQP_HAND_L) //Shield card won't go on left weapon.
+ if(sd->inventory_data[i]->type==IT_WEAPON && ep==EQP_SHIELD) //Shield card won't go on left weapon.
continue;
- for(j=0;j<sd->inventory_data[i]->slot;j++){
- if( sd->status.inventory[i].card[j]==0 )
- break;
- }
- if(j==sd->inventory_data[i]->slot) // No room
+ ARR_FIND( 0, sd->inventory_data[i]->slot, j, sd->status.inventory[i].card[j] == 0 );
+ if( j == sd->inventory_data[i]->slot ) // No room
continue;
WFIFOW(fd,4+c*2)=i+2;