vending bugfix for bugreport:947

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@15188 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
shennetsind
2011-12-20 13:51:30 +00:00
parent 16314f4a50
commit 536aa821ec
3 changed files with 7 additions and 4 deletions

View File

@@ -141,6 +141,7 @@ struct map_session_data {
unsigned short autolootid; // [Zephyrus]
unsigned short autobonus; //flag to indicate if an autobonus is activated. [Inkfish]
struct guild *gmaster_flag;
unsigned int prevend : 1;//used to flag wheather you've spent 40sp to open the vending or not.
} state;
struct {
unsigned char no_weapon_damage, no_magic_damage, no_misc_damage;

View File

@@ -5178,8 +5178,10 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
{ //Prevent vending of GMs with unnecessary Level to trade/drop. [Skotlex]
if ( !pc_can_give_items(pc_isGM(sd)) )
clif_skill_fail(sd,skillid,0,0);
else
else {
sd->state.prevend = 1;
clif_openvendingreq(sd,2+skilllv);
}
}
break;

View File

@@ -254,8 +254,8 @@ void vending_openvending(struct map_session_data* sd, const char* message, bool
if( !flag ) // cancelled
return; // nothing to do
if (pc_istrading(sd))
return; // can't have 2 shops at once
if ( pc_isdead(sd) || pc_istrading(sd))
return; // can't open vendings lying dead || can't have 2 shops at once
vending_skill_lvl = pc_checkskill(sd, MC_VENDING);
// skill level and cart check
@@ -306,7 +306,7 @@ void vending_openvending(struct map_session_data* sd, const char* message, bool
clif_skill_fail(sd, MC_VENDING, 0, 0); // custom reply packet
return;
}
sd->state.prevend = 0;
sd->state.vending = true;
sd->vender_id = vending_getuid();
sd->vend_num = i;