diff options
author | GmOcean <hyperassassin@gmail.com> | 2014-12-03 18:59:29 -1000 |
---|---|---|
committer | GmOcean <hyperassassin@gmail.com> | 2014-12-03 18:59:29 -1000 |
commit | 7a9133ed8fa1c20063324ad8fe2517e6b6470cc4 (patch) | |
tree | b1b1d02e6920874e4ea22045add3dfe2058c2f04 /src/map | |
parent | 770b2bde8b3553449d6f33b1a86d2c871f80127d (diff) | |
download | hercules-7a9133ed8fa1c20063324ad8fe2517e6b6470cc4.tar.gz hercules-7a9133ed8fa1c20063324ad8fe2517e6b6470cc4.tar.bz2 hercules-7a9133ed8fa1c20063324ad8fe2517e6b6470cc4.tar.xz hercules-7a9133ed8fa1c20063324ad8fe2517e6b6470cc4.zip |
Modified *checkbound & *equip2 commands in src/map/script.c
Modified the corresponding documentation to match source code.
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/script.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/map/script.c b/src/map/script.c index 89bc74643..d8a2e297f 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -13933,7 +13933,7 @@ BUILDIN(autoequip) /*======================================================= * Equip2 - * equip2 <item id>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>}; + * equip2 <item id>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>; *-------------------------------------------------------*/ BUILDIN(equip2) { @@ -13941,10 +13941,7 @@ BUILDIN(equip2) struct item_data *item_data; TBL_PC *sd; - if ( script_hasdata(st,9) ) - sd = map->id2sd(script_getnum(st,9)); - else - sd = script->rid2sd(st); + sd = script->rid2sd(st); if ( sd == NULL ) { script_pushint(st,0); @@ -18687,7 +18684,7 @@ BUILDIN(countbound) *------------------------------------------*/ BUILDIN(checkbound){ int i, nameid = script_getnum(st,2); - int bound_type, ref, attr, c1, c2, c3, c4; + int bound_type = 0, ref, attr, c1, c2, c3, c4; TBL_PC *sd; sd = script->rid2sd(st); @@ -18699,8 +18696,10 @@ BUILDIN(checkbound){ return false; } - bound_type = ( script_hasdata(st,3) ? script_getnum(st,3) : -1 ); - if( bound_type < -1 || bound_type > IBT_MAX ){ + if (script_hasdata(st,3)) + bound_type = script_getnum(st,3); + + if( bound_type <= -1 || bound_type > IBT_MAX ){ ShowError("script_checkbound: Not a valid bind type! Type=%d\n", bound_type); } @@ -18711,7 +18710,7 @@ BUILDIN(checkbound){ ( sd->status.inventory[i].card[1] == (script_hasdata(st,7)? (c2 = script_getnum(st,7)) : sd->status.inventory[i].card[1]) ) && ( sd->status.inventory[i].card[2] == (script_hasdata(st,8)? (c3 = script_getnum(st,8)) : sd->status.inventory[i].card[2]) ) && ( sd->status.inventory[i].card[3] == (script_hasdata(st,9)? (c4 = script_getnum(st,9)) : sd->status.inventory[i].card[3]) ) && - ( sd->status.inventory[i].bound > 0 && bound_type == -1 || sd->status.inventory[i].bound == bound_type )) ); + ( sd->status.inventory[i].bound > 0 && !bound_type || sd->status.inventory[i].bound == bound_type )) ); if( i < MAX_INVENTORY ){ script_pushint(st, sd->status.inventory[i].bound); |