summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-02-28 15:21:24 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-02-28 15:21:24 +0000
commita30098328dd23029f3385d8e8f74bac626850dbe (patch)
tree738740e0a59e10a5aa8d148d58336bad0a3410ca /src/map
parentcd0f08fb90955fc34546b321d7d8894defcbc7cc (diff)
downloadhercules-a30098328dd23029f3385d8e8f74bac626850dbe.tar.gz
hercules-a30098328dd23029f3385d8e8f74bac626850dbe.tar.bz2
hercules-a30098328dd23029f3385d8e8f74bac626850dbe.tar.xz
hercules-a30098328dd23029f3385d8e8f74bac626850dbe.zip
- Added a check to prevent trades from being commited if either character is in final-save state.
- Checked and cleaned up the online_check code in the char-server. Further connections to the char-server are rejected when the account already has a connection (previously this would happen only if there was already another character IN game, not just waiting on the char-select screen). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9934 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/trade.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/map/trade.c b/src/map/trade.c
index f6c587ddb..e4bb4a4b1 100644
--- a/src/map/trade.c
+++ b/src/map/trade.c
@@ -162,7 +162,7 @@ int impossible_trade_check(struct map_session_data *sd) {
nullpo_retr(1, sd);
- if(sd->deal.zeny > sd->status.zeny)
+ if(sd->deal.zeny > sd->status.zeny)
{
pc_setglobalreg(sd,"ZENY_HACKER",1);
return -1;
@@ -223,6 +223,9 @@ int trade_check(struct map_session_data *sd, struct map_session_data *tsd) {
struct item_data *data;
int trade_i, i, amount, n;
+ if(sd->state.finalsave || tsd->state.finalsave)
+ return 0; //Item transferring fails
+
// check zenys value against hackers (Zeny was already checked on time of adding, but you never know when you lost some zeny since then.
if(sd->deal.zeny > sd->status.zeny || (tsd->status.zeny > MAX_ZENY - sd->deal.zeny))
return 0;