summaryrefslogtreecommitdiff
path: root/src/map/trade.c
diff options
context:
space:
mode:
authorDennis Friis <peavey@inspircd.org>2009-06-22 00:19:49 +0200
committerDennis Friis <peavey@inspircd.org>2009-06-25 01:13:20 +0200
commitf7691aee940029df1f668343b1cf7d444d0ba693 (patch)
tree39c0aca828748ebe42d5773cd872c6c75346907a /src/map/trade.c
parente82db6d8164e1f98e0d9458b2342728f6d7159e1 (diff)
downloadtmwa-f7691aee940029df1f668343b1cf7d444d0ba693.tar.gz
tmwa-f7691aee940029df1f668343b1cf7d444d0ba693.tar.bz2
tmwa-f7691aee940029df1f668343b1cf7d444d0ba693.tar.xz
tmwa-f7691aee940029df1f668343b1cf7d444d0ba693.zip
Fix possible spoof/dupe with storage. Fix from ea stable branch.
Diffstat (limited to 'src/map/trade.c')
-rw-r--r--src/map/trade.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/map/trade.c b/src/map/trade.c
index 20f1882..e804ad7 100644
--- a/src/map/trade.c
+++ b/src/map/trade.c
@@ -8,6 +8,7 @@
#include "pc.h"
#include "npc.h"
#include "battle.h"
+#include "storage.h"
#include "nullpo.h"
/*==========================================
@@ -61,6 +62,7 @@ void trade_traderequest(struct map_session_data *sd,int target_id)
void trade_tradeack(struct map_session_data *sd,int type)
{
struct map_session_data *target_sd;
+ struct storage *stor;
nullpo_retv(sd);
@@ -77,6 +79,15 @@ void trade_tradeack(struct map_session_data *sd,int type)
npc_event_dequeue(sd);
if(target_sd->npc_id != 0)
npc_event_dequeue(target_sd);
+
+ //close STORAGE window if it's open. It protects from spooffing packets [Lupus]
+ nullpo_retv(stor=account2storage2(sd->status.account_id));
+ if(stor->storage_status == 1) {
+ if (sd->state.storage_flag) //is it Guild Storage or Common
+ storage_guild_storageclose(sd);
+ else
+ storage_storageclose(sd);
+ }//END OF STORAGE CLOSE
}
}