From 147271d2222ea05047ff5542a01b2d36d67a22d3 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Thu, 24 Oct 2013 15:03:48 -0700 Subject: Only show MOTD once --- src/map/clif.cpp | 3 ++- src/map/map.hpp | 1 + src/map/pc.cpp | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/map/clif.cpp b/src/map/clif.cpp index 3d6ef98..0ac518e 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -3597,7 +3597,8 @@ void clif_parse_LoadEndAck(int, dumb_ptr sd) sd->bl_x + AREA_SIZE, sd->bl_y + AREA_SIZE, BL::NUL); - pc_show_motd(sd); + if (!sd->state.seen_motd) + pc_show_motd(sd); } /*========================================== diff --git a/src/map/map.hpp b/src/map/map.hpp index e288d36..e1f8422 100644 --- a/src/map/map.hpp +++ b/src/map/map.hpp @@ -154,6 +154,7 @@ struct map_session_data : block_list, SessionData unsigned shroud_hides_name_talking:1; unsigned shroud_disappears_on_pickup:1; unsigned shroud_disappears_on_talk:1; + unsigned seen_motd:1; } state; struct { diff --git a/src/map/pc.cpp b/src/map/pc.cpp index 06b7ceb..a723555 100644 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -777,6 +777,7 @@ int pc_authok(int id, int login_id2, TimeT connect_until_time, // this is far from the only such thing, but most of the others are logs void pc_show_motd(dumb_ptr sd) { + sd->state.seen_motd = true; std::ifstream in(motd_txt.c_str()); if (in.is_open()) { -- cgit v1.2.3-70-g09d2