summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormekolat <mekolat@users.noreply.github.com>2016-11-09 13:48:45 -0500
committerGitHub <noreply@github.com>2016-11-09 13:48:45 -0500
commit8c380d5b71de0c60866fdd95c6e8d1a54459123f (patch)
treeb6ed167112e97b95272bdec195f0d9328a027713
parentb042d4bdead7fbfa73f6542d2fe0c087f371d9f9 (diff)
parent4a725673d6305ad3514b64b05ce7087cdc79783b (diff)
downloadtmwa-8c380d5b71de0c60866fdd95c6e8d1a54459123f.tar.gz
tmwa-8c380d5b71de0c60866fdd95c6e8d1a54459123f.tar.bz2
tmwa-8c380d5b71de0c60866fdd95c6e8d1a54459123f.tar.xz
tmwa-8c380d5b71de0c60866fdd95c6e8d1a54459123f.zip
Merge pull request #230 from mekolat/npc_num-fixv16.11.9
Decrease the map npc counter when a npc is deleted
-rw-r--r--CHANGELOG2
-rw-r--r--src/map/map.cpp3
2 files changed, 5 insertions, 0 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 52bf906..53192da 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,5 @@
+v16.11.9
+ - fix a bug that did not decrease the npc counter on npc despawn
v16.5.12
- add target argument to the getmap() builtin
- make builtin overrideattack dumber; make scripts handle the logic
diff --git a/src/map/map.cpp b/src/map/map.cpp
index e7b0da8..08d5ceb 100644
--- a/src/map/map.cpp
+++ b/src/map/map.cpp
@@ -208,6 +208,9 @@ int map_delblock(dumb_ptr<block_list> bl)
return 0;
}
+ if (bl->bl_type == BL::NPC)
+ bl->bl_m->npc_num--;
+
if (bl->bl_type == BL::PC)
bl->bl_m->users--;