summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2019-04-17 05:53:39 +0300
committerAndrei Karas <akaras@inbox.ru>2019-05-05 22:22:06 +0300
commit53e2d725238f7e20e40e787f9f0535e873e14e0f (patch)
tree1a5299057529ff93ce8408118e2dd7de3caa2111
parentfb489a671b38375f8acecff79b9bdacc265d0abe (diff)
downloadhercules-53e2d725238f7e20e40e787f9f0535e873e14e0f.tar.gz
hercules-53e2d725238f7e20e40e787f9f0535e873e14e0f.tar.bz2
hercules-53e2d725238f7e20e40e787f9f0535e873e14e0f.tar.xz
hercules-53e2d725238f7e20e40e787f9f0535e873e14e0f.zip
Force saving party allow flag on each packet change
Also add configuration bit in save_settings flag for control it.
-rw-r--r--conf/map/map-server.conf1
-rw-r--r--src/map/clif.c9
2 files changed, 9 insertions, 1 deletions
diff --git a/conf/map/map-server.conf b/conf/map/map-server.conf
index e1de55edb..dbb343748 100644
--- a/conf/map/map-server.conf
+++ b/conf/map/map-server.conf
@@ -106,6 +106,7 @@ map_configuration: {
// 0x040: After successfully get/delete/complete a quest
// 0x080: After every buying store transaction
// 0x100: After every bank transaction (deposit/withdraw)
+ // 0x200: After every allow party flag change
// NOTE: These settings decrease the chance of dupes/lost items
// when there's a server crash at the expense of increasing the
// map/char server lag. If your server rarely crashes, but
diff --git a/src/map/clif.c b/src/map/clif.c
index 6e2031271..c62d2f8fa 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -17267,7 +17267,14 @@ static void clif_parse_PartyTick(int fd, struct map_session_data *sd) __attribut
static void clif_parse_PartyTick(int fd, struct map_session_data *sd)
{
const struct PACKET_CZ_PARTY_CONFIG *const p = RFIFOP(fd, 0);
- sd->status.allow_party = p->refuseInvite ? false : true;
+ const bool newAllowParty = p->refuseInvite ? false : true;
+ if (newAllowParty != sd->status.allow_party) {
+ sd->status.allow_party = newAllowParty;
+ if ((map->save_settings & 512) != 0)
+ chrif->save(sd, 0); // send to char server
+ } else {
+ sd->status.allow_party = newAllowParty;
+ }
clif->partytickack(sd, sd->status.allow_party);
}