Closed boformer closed 9 years ago
Could prop be null in ZoneBlockDetour at Line 754?
foreach (var prop in buildingInfo.m_props)
It's the only thing I can see that would throw a NullReferenceException in SimulationStep.
Yes, maybe m_props is null in some cases.
What I had in mind is that if prop is null then it would throw an exception when you try to access m_position on the next line :
biggestPropPosZ = Mathf.Max(biggestPropPosZ, buildingInfo.m_expandFrontYard ? prop.m_position.z : -prop.m_position.z);
so maybe you should add a test, it wouldn't hurt.
if (prop != null) biggestPropPosZ = Mathf.Max(biggestPropPosZ, buildingInfo.m_expandFrontYard ? prop.m_position.z : -prop.m_position.z);
EDIT: But I guess if m_prop is null it would also throw a NullReferenceException
I pushed a fix to master. Do you know how to enable line numbers in exceptions? That would be so helpful.
The game isn't compiled in debug mode so no line numbers unfortunately. Maybe with a hacked mono VM or something.
Nailed it down. This is the issue:
Description: