Skip to content

Commit

Permalink
Merge pull request #230 from mekolat/npc_num-fix
Browse files Browse the repository at this point in the history
Decrease the map npc counter when a npc is deleted
  • Loading branch information
mekolat authored Nov 9, 2016
2 parents b042d4b + 4a72567 commit 8c380d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/map/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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--;

Expand Down

0 comments on commit 8c380d5

Please sign in to comment.