diff options
-rw-r--r-- | src/map/pc.h | 1 | ||||
-rw-r--r-- | src/map/skill.c | 4 | ||||
-rw-r--r-- | src/map/vending.c | 6 |
3 files changed, 7 insertions, 4 deletions
diff --git a/src/map/pc.h b/src/map/pc.h index 7af04937a..492c21e99 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -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; diff --git a/src/map/skill.c b/src/map/skill.c index d675c12df..40d57f229 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -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; diff --git a/src/map/vending.c b/src/map/vending.c index 3bb528509..a34c715ee 100644 --- a/src/map/vending.c +++ b/src/map/vending.c @@ -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; |