Fixed crash bug caused by door flags