Yup. When I last looked into it the overwhelming amount of fire deaths were squatters lighting fires in derelict homes, and were not in a state of mind to escape.
Better homeless shelter policies & mental health support would be wildly more effective at preventing fire deaths than code enforcement.