diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-04-18 08:12:55 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-04-18 08:12:55 +0000 |
commit | 1e5d5e21e151957e7ebbd1fde2942b522a11418e (patch) | |
tree | 22f3808ff1b103a38402496dc2841790e29bd1ae /src/map/vending.c | |
parent | 1ab4f1bc8045feef435858fadb27dd2e2ce111b4 (diff) | |
download | hercules-1e5d5e21e151957e7ebbd1fde2942b522a11418e.tar.gz hercules-1e5d5e21e151957e7ebbd1fde2942b522a11418e.tar.bz2 hercules-1e5d5e21e151957e7ebbd1fde2942b522a11418e.tar.xz hercules-1e5d5e21e151957e7ebbd1fde2942b522a11418e.zip |
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
Diffstat (limited to 'src/map/vending.c')
-rw-r--r-- | src/map/vending.c | 6 |
1 files changed, 6 insertions, 0 deletions
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 ) { |