summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2010-10-02 01:04:21 +0000
committerChuck Miller <shadowmil@gmail.com>2010-10-02 19:20:22 -0400
commitba5d9bec7ce5330062481643905a6fd60126002c (patch)
tree623f63fb42924818a29b699c959a626b4a7696e4 /src/map/clif.c
parent6ccc96ebaf8b7daf141febcd1d6e5266191bb41b (diff)
downloadtmwa-ba5d9bec7ce5330062481643905a6fd60126002c.tar.gz
tmwa-ba5d9bec7ce5330062481643905a6fd60126002c.tar.bz2
tmwa-ba5d9bec7ce5330062481643905a6fd60126002c.tar.xz
tmwa-ba5d9bec7ce5330062481643905a6fd60126002c.zip
Limit most guild actions to Guild Master position.
Also allow change guild positions to guild owner even without Guild Master position. Signed-off-by: Chuck Miller <shadowmil@gmail.com>
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 32340f9..205c222 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -8647,7 +8647,19 @@ void clif_parse_GuildReqeustInfo (int fd, struct map_session_data *sd)
*/
void clif_parse_GuildChangePositionInfo (int fd, struct map_session_data *sd)
{
- int i;
+ struct guild *g;
+ int i, ps;
+
+ nullpo_retv (sd);
+
+ g = guild_search (sd->status.guild_id);
+
+ if (g == NULL)
+ return;
+
+ if ((ps = guild_getposition (sd, g)) < 0
+ || (!(g->position[ps].mode & 0x0010) && strcmp (g->master, sd->status.name)))
+ return;
for (i = 4; i < RFIFOW (fd, 2); i += 40)
{
@@ -8663,10 +8675,20 @@ void clif_parse_GuildChangePositionInfo (int fd, struct map_session_data *sd)
void clif_parse_GuildChangeMemberPosition (int fd,
struct map_session_data *sd)
{
- int i;
+ struct guild *g;
+ int i, ps;
nullpo_retv (sd);
+ g = guild_search (sd->status.guild_id);
+
+ if (g == NULL)
+ return;
+
+ if ((ps = guild_getposition (sd, g)) < 0
+ || (!(g->position[ps].mode & 0x0010) && strcmp (g->master, sd->status.name)))
+ return;
+
for (i = 4; i < RFIFOW (fd, 2); i += 12)
{
guild_change_memberposition (sd->status.guild_id,