summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2013-10-24 15:03:48 -0700
committerBen Longbons <b.r.longbons@gmail.com>2013-10-24 15:03:48 -0700
commit147271d2222ea05047ff5542a01b2d36d67a22d3 (patch)
treef5d1bb39c1f48aad1e3323f453895de7e3b9fb2e /src
parenta2dc72e6f957f8e44713eaedd93fd32b69f360fa (diff)
downloadtmwa-147271d2222ea05047ff5542a01b2d36d67a22d3.tar.gz
tmwa-147271d2222ea05047ff5542a01b2d36d67a22d3.tar.bz2
tmwa-147271d2222ea05047ff5542a01b2d36d67a22d3.tar.xz
tmwa-147271d2222ea05047ff5542a01b2d36d67a22d3.zip
Only show MOTD once
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.cpp3
-rw-r--r--src/map/map.hpp1
-rw-r--r--src/map/pc.cpp1
3 files changed, 4 insertions, 1 deletions
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<map_session_data> 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<map_session_data> sd)
{
+ sd->state.seen_motd = true;
std::ifstream in(motd_txt.c_str());
if (in.is_open())
{