summaryrefslogtreecommitdiff
path: root/src/map/guild.c
diff options
context:
space:
mode:
authorshennetsind <shennetsind@users.noreply.github.com>2013-11-07 11:10:40 -0800
committershennetsind <shennetsind@users.noreply.github.com>2013-11-07 11:10:40 -0800
commit01e4647db2d5c635c7b4447f37663797a3f47b99 (patch)
tree94303465410557176454305aeeab76a13ca8514d /src/map/guild.c
parent9f32aa958f86a228290c43544c8b9bbf3f1c2cc0 (diff)
parent951b18c97a09426e2f14801263c2fd07efbd46bb (diff)
downloadhercules-01e4647db2d5c635c7b4447f37663797a3f47b99.tar.gz
hercules-01e4647db2d5c635c7b4447f37663797a3f47b99.tar.bz2
hercules-01e4647db2d5c635c7b4447f37663797a3f47b99.tar.xz
hercules-01e4647db2d5c635c7b4447f37663797a3f47b99.zip
Merge pull request #220 from shennetsind/master
mhalicot's Item Bind Pull Request
Diffstat (limited to 'src/map/guild.c')
-rw-r--r--src/map/guild.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/src/map/guild.c b/src/map/guild.c
index fcdcddab2..cba568bd8 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -865,6 +865,11 @@ int guild_member_withdraw(int guild_id, int account_id, int char_id, int flag, c
online_member_sd = guild->getavailablesd(g);
if(online_member_sd == NULL)
return 0; // noone online to inform
+
+#ifdef GP_BOUND_ITEMS
+ //Guild bound item check
+ guild->retrieveitembound(char_id,account_id,guild_id);
+#endif
if(!flag)
clif->guild_leave(online_member_sd, name, mes);
@@ -899,6 +904,28 @@ int guild_member_withdraw(int guild_id, int account_id, int char_id, int flag, c
return 0;
}
+void guild_retrieveitembound(int char_id,int aid,int guild_id) {
+#ifdef GP_BOUND_ITEMS
+ TBL_PC *sd = map->id2sd(aid);
+ if(sd){ //Character is online
+ pc->bound_clear(sd,IBT_GUILD);
+ } else { //Character is offline, ask char server to do the job
+ struct guild_storage *gstor = gstorage->id2storage2(guild_id);
+ if(gstor && gstor->storage_status == 1) { //Someone is in guild storage, close them
+ struct s_mapiterator* iter = mapit_getallusers();
+ for( sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); sd = (TBL_PC*)mapit->next(iter) ) {
+ if(sd->status.guild_id == guild_id && sd->state.storage_flag == 2) {
+ gstorage->close(sd);
+ break;
+ }
+ }
+ mapit->free(iter);
+ }
+ intif->itembound_req(char_id,aid,guild_id);
+ }
+#endif
+}
+
int guild_send_memberinfoshort(struct map_session_data *sd,int online)
{ // cleaned up [LuzZza]
struct guild *g;
@@ -1813,7 +1840,7 @@ int guild_break(struct map_session_data *sd,char *name) {
struct guild *g;
struct unit_data *ud;
int i;
-
+
nullpo_ret(sd);
if( (g=sd->guild)==NULL )
@@ -1855,6 +1882,10 @@ int guild_break(struct map_session_data *sd,char *name) {
skill->del_unitgroup(groups[i],ALC_MARK);
}
}
+
+#ifdef GP_BOUND_ITEMS
+ pc->bound_clear(sd,IBT_GUILD);
+#endif
intif->guild_break(g->guild_id);
return 1;
@@ -2328,4 +2359,6 @@ void guild_defaults(void) {
guild->check_member = guild_check_member;
guild->get_alliance_count = guild_get_alliance_count;
guild->castle_reconnect_sub = guild_castle_reconnect_sub;
+ /* */
+ guild->retrieveitembound = guild_retrieveitembound;
}