Bug fixes & misc:

- Follow up 7fd6776, correcting how to make player sit by autotrade persistance.
- Follow up 7fd6776, pc_setstand() does a check if player can stand or not.
- bugreport:9174, buyingstore_close() doesn't clear buyingstores data on table.
- Fixed "missing" buyingstore search (purchase type search) in searchstore, by adding DBMap *buyingstore_db.
- Added nullpo checks on some buyingstore.c functions.
- Added do_init_buyingstore() and do_final_buyingstore().
- Failing autotrader from pc_setpos(). (Since autotrade doesn't have 'fd'? FIXME later)

Signed-off-by: Cydh Ramdh <house.bad@gmail.com>
This commit is contained in:
Cydh Ramdh
2014-08-02 11:07:26 +07:00
parent caa80ecfc7
commit 8a819403c1
17 changed files with 181 additions and 114 deletions

View File

@@ -308,7 +308,7 @@ const char* parse_syntax_close_sub(const char* p,int* flag);
const char* parse_syntax(const char* p);
static int parse_syntax_for_flag = 0;
extern int current_equip_item_index; //for New CARDS Scripts. It contains Inventory Index of the EQUIP_SCRIPT caller item. [Lupus]
extern short current_equip_item_index; //for New CARDS Scripts. It contains Inventory Index of the EQUIP_SCRIPT caller item. [Lupus]
int potion_flag=0; //For use on Alchemist improved potions/Potion Pitcher. [Skotlex]
int potion_hp=0, potion_per_hp=0, potion_sp=0, potion_per_sp=0;
int potion_target=0;
@@ -13145,8 +13145,7 @@ BUILDIN_FUNC(skilleffect)
/* Ensure we're standing because the following packet causes the client to virtually set the char to stand,
* which leaves the server thinking it still is sitting. */
if( pc_issit(sd) ) {
pc_setstand(sd);
if( pc_issit(sd) && pc_setstand(sd, false) ) {
skill_sit(sd, 0);
clif_standing(&sd->bl);
}
@@ -14014,7 +14013,7 @@ BUILDIN_FUNC(isday)
BUILDIN_FUNC(isequippedcnt)
{
TBL_PC *sd;
int i, j, k, id = 1;
int i, id = 1;
int ret = 0;
sd = script_rid2sd(st);
@@ -14024,13 +14023,13 @@ BUILDIN_FUNC(isequippedcnt)
}
for (i=0; id!=0; i++) {
short j;
FETCH (i+2, id) else id = 0;
if (id <= 0)
continue;
for (j=0; j<EQI_MAX; j++) {
int index;
index = sd->equip_index[j];
short index = sd->equip_index[j];
if(index < 0)
continue;
if (pc_is_same_equip_index((enum equip_index)j, sd->equip_index, index))
@@ -14043,6 +14042,7 @@ BUILDIN_FUNC(isequippedcnt)
if (sd->inventory_data[index]->nameid == id)
ret+= sd->status.inventory[index].amount;
} else { //Count cards.
short k;
if (itemdb_isspecial(sd->status.inventory[index].card[0]))
continue; //No cards
for(k=0; k<sd->inventory_data[index]->slot; k++) {
@@ -14066,8 +14066,7 @@ BUILDIN_FUNC(isequippedcnt)
BUILDIN_FUNC(isequipped)
{
TBL_PC *sd;
int i, j, k, id = 1;
int index, flag;
int i, id = 1;
int ret = -1;
//Original hash to reverse it when full check fails.
unsigned int setitem_hash = 0, setitem_hash2 = 0;
@@ -14076,18 +14075,19 @@ BUILDIN_FUNC(isequipped)
if (!sd) { //If the player is not attached it is a script error anyway... but better prevent the map server from crashing...
script_pushint(st,0);
return 0;
return SCRIPT_CMD_SUCCESS;
}
setitem_hash = sd->bonus.setitem_hash;
setitem_hash2 = sd->bonus.setitem_hash2;
for (i=0; id!=0; i++) {
int flag = 0;
short j;
FETCH (i+2, id) else id = 0;
if (id <= 0)
continue;
flag = 0;
for (j=0; j<EQI_MAX; j++) {
index = sd->equip_index[j];
short index = sd->equip_index[j];
if(index < 0)
continue;
if (pc_is_same_equip_index((enum equip_index)i, sd->equip_index, index))
@@ -14102,6 +14102,7 @@ BUILDIN_FUNC(isequipped)
flag = 1;
break;
} else { //Cards
short k;
if (sd->inventory_data[index]->slot == 0 ||
itemdb_isspecial(sd->status.inventory[index].card[0]))
continue;
@@ -18296,8 +18297,7 @@ BUILDIN_FUNC(stand)
if( sd == NULL)
return SCRIPT_CMD_FAILURE;
if( pc_issit(sd) ) {
pc_setstand(sd);
if( pc_issit(sd) && pc_setstand(sd, false)) {
skill_sit(sd, 0);
clif_standing(&sd->bl);
}