Skip to content

Commit

Permalink
Cleaned up CZ_PARTY_CONFIG (rathena#8204)
Browse files Browse the repository at this point in the history
Thanks to @aleos89
  • Loading branch information
Lemongrass3110 authored Apr 2, 2024
1 parent b0902a4 commit 349b04b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 18 deletions.
3 changes: 2 additions & 1 deletion src/common/mmo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,8 @@ struct mmo_charstatus {
#ifdef HOTKEY_SAVING
struct hotkey hotkeys[MAX_HOTKEYS_DB];
#endif
bool show_equip,allow_party, disable_call;
bool show_equip, disable_call;
bool disable_partyinvite;
short rename;

time_t delete_date;
Expand Down
24 changes: 9 additions & 15 deletions src/map/clif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8044,7 +8044,7 @@ void clif_partyinvitationstate( map_session_data& sd ){
struct PACKET_ZC_PARTY_CONFIG p = {};

p.packetType = HEADER_ZC_PARTY_CONFIG;
p.denyPartyInvites = 0; // TODO: not implemented
p.denyPartyInvites = sd.status.disable_partyinvite;

clif_send( &p, sizeof( p ), &sd.bl, SELF );
#endif
Expand Down Expand Up @@ -17624,13 +17624,14 @@ void clif_parse_configuration( int fd, map_session_data* sd ){

/// Request to change party invitation tick.
/// value:
/// 0 = disabled
/// 1 = enabled
void clif_parse_PartyTick(int fd, map_session_data* sd)
{
bool flag = RFIFOB(fd,6) ? true : false;
sd->status.allow_party = flag;
clif_partytickack(sd, flag);
/// 0 = disabled (triggered by /accept)
/// 1 = enabled (triggered by /refuse)
void clif_parse_PartyTick( int fd, map_session_data* sd ){
PACKET_CZ_PARTY_CONFIG* p = (PACKET_CZ_PARTY_CONFIG*)RFIFOP( fd, 0 );

sd->status.disable_partyinvite = p->refuseInvite;

clif_partyinvitationstate( *sd );
}

/// Questlog System [Kevin] [Inkfish]
Expand Down Expand Up @@ -19811,13 +19812,6 @@ void __attribute__ ((unused)) clif_parse_dull(int fd, map_session_data *sd) {
return;
}

void clif_partytickack(map_session_data* sd, bool flag) {
WFIFOHEAD(sd->fd, packet_len(0x2c9));
WFIFOW(sd->fd,0) = 0x2c9;
WFIFOB(sd->fd,2) = flag;
WFIFOSET(sd->fd, packet_len(0x2c9));
}

/// Ack world info (ZC_ACK_BEFORE_WORLD_INFO)
/// 0979 <world name>.24B <char name>.24B
void clif_ackworldinfo(map_session_data* sd) {
Expand Down
1 change: 0 additions & 1 deletion src/map/clif.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,6 @@ void clif_hom_food(map_session_data *sd,int foodid,int fail); //[orn]
void clif_send_homdata(map_session_data *sd, int state, int param); //[orn]

void clif_configuration( map_session_data* sd, enum e_config_type type, bool enabled );
void clif_partytickack(map_session_data* sd, bool flag);
void clif_viewequip_ack(map_session_data* sd, map_session_data* tsd);
void clif_equipcheckbox(map_session_data* sd);

Expand Down
2 changes: 1 addition & 1 deletion src/map/clif_packetdb.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,7 @@
parseable_packet(0x02c4,26,clif_parse_PartyInvite2,2);
packet(0x02c5,30);
parseable_packet(0x02c7,7,clif_parse_ReplyPartyInvite2,2,6);
parseable_packet(0x02c8,3,clif_parse_PartyTick,2);
parseable_packet( HEADER_CZ_PARTY_CONFIG, sizeof( PACKET_CZ_PARTY_CONFIG ), clif_parse_PartyTick, 0 );
packet(0x02ca,3);
packet(0x02cb,20);
packet(0x02cc,4);
Expand Down

0 comments on commit 349b04b

Please sign in to comment.