From f170e3487ec91f5f5a9e17acffc6cd499df373eb Mon Sep 17 00:00:00 2001 From: Kenpachi Developer Date: Mon, 22 Jun 2020 03:13:25 +0200 Subject: Add battle flag for overweight messages display --- src/map/battle.c | 1 + src/map/battle.h | 1 + src/map/clif.c | 15 +++++++++++---- 3 files changed, 13 insertions(+), 4 deletions(-) (limited to 'src/map') diff --git a/src/map/battle.c b/src/map/battle.c index e8d8e581f..0ef9c66e8 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -7434,6 +7434,7 @@ static const struct battle_data { { "drop_connection_on_quit", &battle_config.drop_connection_on_quit, 0, 0, 1, }, { "display_rate_messages", &battle_config.display_rate_messages, 1, 0, 7, }, { "display_config_messages", &battle_config.display_config_messages, 0x1F1, 0, 0x1F7, }, + { "display_overweight_messages", &battle_config.display_overweight_messages, 3, 0, 3, }, { "features/enable_refinery_ui", &battle_config.enable_refinery_ui, 1, 0, 1, }, { "features/replace_refine_npcs", &battle_config.replace_refine_npcs, 1, 0, 1, }, { "batk_min_limit", &battle_config.batk_min, 0, 0, INT_MAX, }, diff --git a/src/map/battle.h b/src/map/battle.h index ceb94321e..19cfd2748 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -593,6 +593,7 @@ struct Battle_Config { int drop_connection_on_quit; int display_rate_messages; int display_config_messages; + int display_overweight_messages; int enable_refinery_ui; int replace_refine_npcs; diff --git a/src/map/clif.c b/src/map/clif.c index f7f22f7b0..517b03add 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -10787,10 +10787,6 @@ static void clif_parse_LoadEndAck(int fd, struct map_session_data *sd) // Check for and delete unavailable/disabled items. pc->checkitem(sd); - // Send the character's weight to the client. - clif->updatestatus(sd, SP_WEIGHT); - clif->updatestatus(sd, SP_MAXWEIGHT); - // Send character's guild info to the client. Call this before clif->spawn() to show guild emblems correctly. if (sd->status.guild_id != 0) guild->send_memberinfoshort(sd, 1); @@ -10819,6 +10815,17 @@ static void clif_parse_LoadEndAck(int fd, struct map_session_data *sd) map->addblock(&sd->bl); // Add the character to the map. clif->spawn(&sd->bl); // Spawn character client side. + if (((battle_config.display_overweight_messages & 0x1) != 0 && sd->state.connect_new != 0) + || ((battle_config.display_overweight_messages & 0x2) != 0 && sd->state.connect_new == 0 && sd->state.changemap != 0)) { + // Send the character's weight to the client. (With displaying overweight messages.) + clif->updatestatus(sd, SP_MAXWEIGHT); + clif->updatestatus(sd, SP_WEIGHT); + } else { + // Send the character's weight to the client. (Without displaying overweight messages.) + clif->updatestatus(sd, SP_WEIGHT); + clif->updatestatus(sd, SP_MAXWEIGHT); + } + struct party_data *p = NULL; if (sd->status.party_id != 0) -- cgit v1.2.3-60-g2f50