From ea528aef3470c5829c5f2c887b0be104f5adeafb Mon Sep 17 00:00:00 2001
From: mekolat <mekolat@users.noreply.github.com>
Date: Thu, 12 May 2016 15:21:22 -0400
Subject: add undefined_gat check for SenWho::ALL_SAMEMAP

---
 src/map/clif.cpp | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

(limited to 'src/map')

diff --git a/src/map/clif.cpp b/src/map/clif.cpp
index bd7f4ef..d4b16a7 100644
--- a/src/map/clif.cpp
+++ b/src/map/clif.cpp
@@ -305,16 +305,19 @@ int clif_send(const Buffer& buf, dumb_ptr<block_list> bl, SendWho type, ClientVe
             }
             break;
         case SendWho::ALL_SAMEMAP:      // 同じマップの全クライアントに送信
-            for (io::FD i : iter_fds())
+            if (bl->bl_m != borrow(undefined_gat))
             {
-                Session *s = get_session(i);
-                if (!s)
-                    continue;
-                dumb_ptr<map_session_data> sd = dumb_ptr<map_session_data>(static_cast<map_session_data *>(s->session_data.get()));
-                if (sd && sd->state.auth && !sd->state.connect_new && sd->bl_m == bl->bl_m)
+                for (io::FD i : iter_fds())
                 {
+                    Session *s = get_session(i);
+                    if (!s)
+                        continue;
+                    dumb_ptr<map_session_data> sd = dumb_ptr<map_session_data>(static_cast<map_session_data *>(s->session_data.get()));
+                    if (sd && sd->state.auth && !sd->state.connect_new && sd->bl_m == bl->bl_m)
                     {
-                        send_buffer(s, buf);
+                        {
+                            send_buffer(s, buf);
+                        }
                     }
                 }
             }
-- 
cgit v1.2.3-70-g09d2


From 67fba86142da3c188ccede6c9403afbc2cd72ea1 Mon Sep 17 00:00:00 2001
From: mekolat <mekolat@users.noreply.github.com>
Date: Thu, 12 May 2016 15:32:49 -0400
Subject: add undefined_gat check to npc_propagate_update()

---
 src/map/npc.cpp | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'src/map')

diff --git a/src/map/npc.cpp b/src/map/npc.cpp
index 3eb13b3..2600117 100644
--- a/src/map/npc.cpp
+++ b/src/map/npc.cpp
@@ -1052,6 +1052,9 @@ void npc_free_internal(dumb_ptr<npc_data> nd_)
 static
 void npc_propagate_update(dumb_ptr<npc_data> nd)
 {
+    if (nd->bl_m == borrow(undefined_gat))
+        return;
+
     int xs = 0, ys = 0;
     if (dumb_ptr<npc_data_script> nd_ = nd->is_script())
     {
-- 
cgit v1.2.3-70-g09d2