summaryrefslogtreecommitdiff
path: root/src/char/int_guild.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2018-07-06 23:24:27 +0200
committerHaru <haru@dotalux.com>2018-07-06 23:24:27 +0200
commit6c99adb0b3de4677fdcc28d636aeaa618ce04bb1 (patch)
tree16060ca60d876c40936794553aee053d9b13c8ee /src/char/int_guild.c
parenteed4e9bb3a466cfe32bdb72df12c7ad2ceb0dd79 (diff)
downloadhercules-6c99adb0b3de4677fdcc28d636aeaa618ce04bb1.tar.gz
hercules-6c99adb0b3de4677fdcc28d636aeaa618ce04bb1.tar.bz2
hercules-6c99adb0b3de4677fdcc28d636aeaa618ce04bb1.tar.xz
hercules-6c99adb0b3de4677fdcc28d636aeaa618ce04bb1.zip
Fix a regression in inter_guild_add_member
Fixes #2122 Regression introduced in 735e2e8340c9522ee5a9afdcad29d191da29c8d4, #2108 Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/char/int_guild.c')
-rw-r--r--src/char/int_guild.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/char/int_guild.c b/src/char/int_guild.c
index e7315ed50..e03278fad 100644
--- a/src/char/int_guild.c
+++ b/src/char/int_guild.c
@@ -969,21 +969,24 @@ static struct guild *inter_guild_create(const char *name, const struct guild_mem
}
// Add member to guild
-static bool inter_guild_add_member(int guild_id, const struct guild_member *member)
+static bool inter_guild_add_member(int guild_id, const struct guild_member *member, int map_fd)
{
struct guild * g;
int i;
nullpo_ret(member);
g = inter_guild->fromsql(guild_id);
- if (g == NULL)
+ if (g == NULL) {
+ mapif->guild_memberadded(map_fd, guild_id, member->account_id, member->char_id, 1); // 1: Failed to add
return false;
+ }
// Find an empty slot
for (i = 0; i < g->max_member; i++) {
if (g->member[i].account_id == 0) {
g->member[i] = *member;
g->member[i].modified = (GS_MEMBER_NEW | GS_MEMBER_MODIFIED);
+ mapif->guild_memberadded(map_fd, guild_id, member->account_id, member->char_id, 0); // 0: success
if (!inter_guild->calcinfo(g)) //Send members if it was not invoked.
mapif->guild_info(-1, g);
@@ -993,6 +996,8 @@ static bool inter_guild_add_member(int guild_id, const struct guild_member *memb
return true;
}
}
+
+ mapif->guild_memberadded(map_fd, guild_id, member->account_id, member->char_id, 1); // 1: Failed to add
return false;
}