summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/battle.c1
-rw-r--r--src/map/battle.h1
-rw-r--r--src/map/vending.c6
3 files changed, 8 insertions, 0 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 7bf119459..19ccf23f5 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3503,6 +3503,7 @@ static const struct _battle_data {
{ "mob_warp", &battle_config.mob_warp, 0, 0, 1|2|4, },
{ "dead_branch_active", &battle_config.dead_branch_active, 1, 0, 1, },
{ "vending_max_value", &battle_config.vending_max_value, 10000000, 1, MAX_ZENY, },
+ { "vending_over_max", &battle_config.vending_over_max, 1, 0, 1, },
{ "show_steal_in_same_party", &battle_config.show_steal_in_same_party, 0, 0, 1, },
{ "party_hp_mode", &battle_config.party_hp_mode, 0, 0, 1, },
{ "show_party_share_picker", &battle_config.party_show_share_picker, 0, 0, 1, },
diff --git a/src/map/battle.h b/src/map/battle.h
index c6c2eb2e9..06fe16723 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -268,6 +268,7 @@ extern struct Battle_Config
int mob_warp;
int dead_branch_active;
int vending_max_value;
+ int vending_over_max;
int vending_tax;
int show_steal_in_same_party;
int party_share_type;
diff --git a/src/map/vending.c b/src/map/vending.c
index 098bfa28f..935971b16 100644
--- a/src/map/vending.c
+++ b/src/map/vending.c
@@ -105,6 +105,12 @@ void vending_purchasereq(struct map_session_data* sd, int id, const uint8* data,
clif_buyvending(sd, idx, amount, 1); // you don't have enough zeny
return;
}
+ if( z + (double)vsd->status.zeny > (double)MAX_ZENY && !battle_config.vending_over_max )
+ {
+ clif_buyvending(sd, idx, vsd->vending[j].amount, 4); // too much zeny = overflow
+ return;
+
+ }
w += itemdb_weight(vsd->status.cart[idx].nameid) * amount;
if( w + sd->weight > sd->max_weight )
{