summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-11-27 09:13:29 -0200
committershennetsind <ind@henn.et>2013-11-27 09:13:29 -0200
commitf28877f6e6b14e4d16c91d3e7d1cfd576737d62a (patch)
tree4180de66293e2dd75c709f764a361c377c18bf77 /src
parent41a1f804e02aca52bf941dd12e4bf08e03e91dca (diff)
downloadhercules-f28877f6e6b14e4d16c91d3e7d1cfd576737d62a.tar.gz
hercules-f28877f6e6b14e4d16c91d3e7d1cfd576737d62a.tar.bz2
hercules-f28877f6e6b14e4d16c91d3e7d1cfd576737d62a.tar.xz
hercules-f28877f6e6b14e4d16c91d3e7d1cfd576737d62a.zip
Fixed Bug 7805
Modified @itembound so that it provides feedback in case of bind conditions that fail to meet. pc_additem messages will remain so that any other area that might create a invalid bind item will still be cancelled and provide feedback. Special Thanks to kyeme. http://hercules.ws/board/tracker/issue-7805-itembound-console-error-when-no-partyguild/ Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src')
-rw-r--r--src/map/atcommand.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index c87a66b72..5c31155b1 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -1117,9 +1117,28 @@ ACMD(item)
return false;
}
- if(!strcmpi(info->command,"itembound") && !(bound >= IBT_MIN && bound <= IBT_MAX) ) {
- clif->message(fd, msg_txt(298)); // Invalid bound type
- return false;
+ if(!strcmpi(info->command,"itembound") ) {
+ if( !(bound >= IBT_MIN && bound <= IBT_MAX) ) {
+ clif->message(fd, msg_txt(298)); // Invalid bound type
+ return false;
+ }
+ switch( (enum e_item_bound_type)bound ) {
+ case IBT_CHARACTER:
+ case IBT_ACCOUNT:
+ break; /* no restrictions */
+ case IBT_PARTY:
+ if( !sd->status.party_id ) {
+ clif->message(fd, msg_txt(1498)); //You can't add a party bound item to a character without party!
+ return false;
+ }
+ break;
+ case IBT_GUILD:
+ if( !sd->status.guild_id ) {
+ clif->message(fd, msg_txt(1499)); //You can't add a guild bound item to a character without guild!
+ return false;
+ }
+ break;
+ }
}
item_id = item_data->nameid;