Thread: is NPC spawned
View Single Post
  #3  
Old 06-20-2014, 02:11 AM
Zaela_S
Hill Giant
 
Join Date: Jun 2012
Posts: 216
Default

Quote:
Originally Posted by Esildor View Post
That seems silly, why would it contain dead mobs?
If I remember correctly, to prevent re-entrancy issues. Lots of things iterate through the NPC list, often with more than one iteration "in progress" at one time. Removing an NPC from the list at the "top level" iteration will make all the other iterations in progress stale and buggy. Much safer to flag the NPC as dead now and then remove it from the list on the next "bottom level" iteration (the NPC::Process cycle).

Because code, in other words.
Reply With Quote