summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-12-20 13:51:30 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-12-20 13:51:30 +0000
commit46ad2a8a7ec3cbad577ec5f83b37afc21f657c01 (patch)
tree55a3673bb5297130115f66157118a22e1aad2f1f /src
parentd0f02711b3eb7e510169a0a66dcbf584f88912a5 (diff)
downloadhercules-46ad2a8a7ec3cbad577ec5f83b37afc21f657c01.tar.gz
hercules-46ad2a8a7ec3cbad577ec5f83b37afc21f657c01.tar.bz2
hercules-46ad2a8a7ec3cbad577ec5f83b37afc21f657c01.tar.xz
hercules-46ad2a8a7ec3cbad577ec5f83b37afc21f657c01.zip
vending bugfix for bugreport:947
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15188 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/pc.h1
-rw-r--r--src/map/skill.c4
-rw-r--r--src/map/vending.c6
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;