From 1e5d5e21e151957e7ebbd1fde2942b522a11418e Mon Sep 17 00:00:00 2001 From: ultramage Date: Fri, 18 Apr 2008 08:12:55 +0000 Subject: Implemented config setting 'vending_over_max', to let people configure the behavior of vending items over the MAX_ZENY limit. Default/official setting is 'yes', which makes players lose zeny that they cannot hold. Adjust as needed. This re-adds the behavior from before r11344 (see topic:180568). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12614 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/vending.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/map/vending.c') 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 ) { -- cgit v1.2.3-60-g2f50