diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-04-03 14:13:13 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-04-03 14:13:13 +0000 |
commit | 33c862fabb849bbd93ef0bbba4688c149aefeccf (patch) | |
tree | 6fc804f30a9721f083bbb5160f1d2a137d9c10d6 /src/map/pc.c | |
parent | 46b54cfef91120e710a87b4af484bc2f67393200 (diff) | |
download | hercules-33c862fabb849bbd93ef0bbba4688c149aefeccf.tar.gz hercules-33c862fabb849bbd93ef0bbba4688c149aefeccf.tar.bz2 hercules-33c862fabb849bbd93ef0bbba4688c149aefeccf.tar.xz hercules-33c862fabb849bbd93ef0bbba4688c149aefeccf.zip |
- Cleaned up (fixed?) a possible overflow in pc_isUseitem, thanks to foobar.
- When you have the wrong ammo-type equipped the skill-failed message is now "skill can't be used with this weapon", which is less misleading than "please equip arrows first".
- Corrected pet-equipment display (I originally assumed they went in the shield view-position, when they actually go in the head-bottom position).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5883 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r-- | src/map/pc.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index b52b48a1f..227b4a9ed 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -2622,11 +2622,17 @@ int pc_isUseitem(struct map_session_data *sd,int n) return 0;
//Not equipable by class. [Skotlex]
- if (!(1<<(sd->class_&MAPID_BASEMASK)&item->class_base[(sd->class_&JOBL_2_1)?1:((sd->class_&JOBL_2_2)?2:0)]))
+ if (!(
+ (1<<(sd->class_&MAPID_BASEMASK)) &
+ (item->class_base[sd->class_&JOBL_2_1?1:(sd->class_&JOBL_2_2?2:0)])
+ ))
return 0;
//Not usable by upper class. [Skotlex]
- if(!(1<<((sd->class_&JOBL_UPPER)?1:((sd->class_&JOBL_BABY)?2:0))&item->class_upper))
+ if(!(
+ (1<<(sd->class_&JOBL_UPPER?1:(sd->class_&JOBL_BABY?2:0))) &
+ item->class_upper
+ ))
return 0;
//Dead Branch & Bloody Branch & Porings Box
|