summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-11 15:53:17 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-11 15:53:17 +0000
commit4d8ac75258434136d7833524ca72b8268fd4a9c7 (patch)
tree84f573fdbd368abb27d835a50df0c348bb51b923
parent3381a5ea9a482409d361f2b36d3aff7a72dcb0c2 (diff)
downloadhercules-4d8ac75258434136d7833524ca72b8268fd4a9c7.tar.gz
hercules-4d8ac75258434136d7833524ca72b8268fd4a9c7.tar.bz2
hercules-4d8ac75258434136d7833524ca72b8268fd4a9c7.tar.xz
hercules-4d8ac75258434136d7833524ca72b8268fd4a9c7.zip
- Trade-requests now fail if the target is in a NPC.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10214 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt1
-rw-r--r--src/map/map.c3
-rw-r--r--src/map/trade.c8
3 files changed, 10 insertions, 2 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 0781b676b..8b3a43145 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,7 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2007/04/12
+ * Trade-requests now fail if the target is in a NPC.
* Some cleaning of the castend_map code to prevent the menuskill variable
from not being cleared if you made a choice but the skill was not triggered
(due to silence, stun or whatever)
diff --git a/src/map/map.c b/src/map/map.c
index d02c6da55..37a6f1d91 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -3154,7 +3154,8 @@ void do_abort(void) {
//Save all characters and then flush the inter-connection.
if (!chrif_isconnect())
{
- ShowFatalError("Server has crashed without a connection to the char-server, character data can't be saved!\n");
+ if (pc_db->size(pc_db))
+ ShowFatalError("Server has crashed without a connection to the char-server, character data can't be saved!\n");
return;
}
ShowError("Server received crash signal! Attempting to save all online characters!\n");
diff --git a/src/map/trade.c b/src/map/trade.c
index 77bc80bdf..40f63e888 100644
--- a/src/map/trade.c
+++ b/src/map/trade.c
@@ -39,7 +39,13 @@ void trade_traderequest(struct map_session_data *sd, struct map_session_data *ta
clif_tradestart(sd, 1); // character does not exist
return;
}
-
+
+ if (target_sd->npc_id)
+ { //Trade fails if you are using an NPC.
+ clif_tradestart(sd, 2);
+ return;
+ }
+
if (!battle_config.invite_request_check) {
if (target_sd->guild_invite > 0 || target_sd->party_invite > 0) {
clif_tradestart(sd, 2);