summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorKenpachi Developer <Kenpachi.Developer@gmx.de>2020-06-22 03:13:25 +0200
committerKenpachi Developer <Kenpachi.Developer@gmx.de>2020-06-22 03:13:25 +0200
commitf170e3487ec91f5f5a9e17acffc6cd499df373eb (patch)
tree339683348b87138327d2156062af675cdcf9bbad /src/map
parent196c182f11aa46056a70507fcd93c97db9be911e (diff)
downloadhercules-f170e3487ec91f5f5a9e17acffc6cd499df373eb.tar.gz
hercules-f170e3487ec91f5f5a9e17acffc6cd499df373eb.tar.bz2
hercules-f170e3487ec91f5f5a9e17acffc6cd499df373eb.tar.xz
hercules-f170e3487ec91f5f5a9e17acffc6cd499df373eb.zip
Add battle flag for overweight messages display
Diffstat (limited to 'src/map')
-rw-r--r--src/map/battle.c1
-rw-r--r--src/map/battle.h1
-rw-r--r--src/map/clif.c15
3 files changed, 13 insertions, 4 deletions
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)