summaryrefslogtreecommitdiff
path: root/src/map/map.cpp
diff options
context:
space:
mode:
authorgumi <mekolat@users.noreply.github.com>2017-11-12 22:14:18 -0500
committergumi <mekolat@users.noreply.github.com>2017-11-12 23:10:14 -0500
commit35b0508a652811a3872f13a6a161a01fee6f5d1d (patch)
tree54779cfbb457c11edf8aee47c4dc44738953e8ec /src/map/map.cpp
parentd0ea54965867c7f93da490b5f1a95f7ac4000bbb (diff)
downloadtmwa-35b0508a652811a3872f13a6a161a01fee6f5d1d.tar.gz
tmwa-35b0508a652811a3872f13a6a161a01fee6f5d1d.tar.bz2
tmwa-35b0508a652811a3872f13a6a161a01fee6f5d1d.tar.xz
tmwa-35b0508a652811a3872f13a6a161a01fee6f5d1d.zip
re-fix the puppet despawn bug
Diffstat (limited to 'src/map/map.cpp')
-rw-r--r--src/map/map.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/map/map.cpp b/src/map/map.cpp
index e7b0da8..3538a59 100644
--- a/src/map/map.cpp
+++ b/src/map/map.cpp
@@ -1009,9 +1009,12 @@ dumb_ptr<block_list> map_id2bl(BlockId id)
int map_addnpc(Borrowed<map_local> m, dumb_ptr<npc_data> nd)
{
int i;
- for (i = 0; i < m->npc_num && i < MAX_NPC_PER_MAP; i++)
- if (m->npc[i] == nullptr)
+ for (i = 0; i < m->npc_num && i < MAX_NPC_PER_MAP; i++) {
+ if (m->npc[i] == nullptr) {
+ PRINTF(">>>>>> reusing npc %i\n"_fmt, i);
break;
+ }
+ }
if (i == MAX_NPC_PER_MAP)
{
if (battle_config.error_log)
@@ -1020,6 +1023,7 @@ int map_addnpc(Borrowed<map_local> m, dumb_ptr<npc_data> nd)
}
if (i == m->npc_num)
{
+ PRINTF(">>>>>> using new npc %i\n"_fmt, i);
m->npc_num++;
}