From 46ad2a8a7ec3cbad577ec5f83b37afc21f657c01 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Tue, 20 Dec 2011 13:51:30 +0000 Subject: vending bugfix for bugreport:947 git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15188 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/pc.h | 1 + src/map/skill.c | 4 +++- src/map/vending.c | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) (limited to 'src/map') 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; -- cgit v1.2.3-70-g09d2