OpenMW/openmw — pull request #158 by scrawl (2014-06-11 14:12:33+00:00)
Title: Merge ESM::Cell fields by subrecord

Fixes an issue with the Morrowind Patched mod where cell ambient values would become black due to the new cell records not including an AMBI subrecord.

This changes the structure of the load method slightly. The potential fallout is huge, so this change should be reviewed carefully.

Also, I think I found a bug in the old code: mLeasedRefs was incorrectly cleared when overwriting a cell (*oldcell = *cell;). If my logic is correct, that would occur when Plugin A moves a references to cell X, then Plugin B (loaded later) overwrites something in cell X, causing the references moved to cell X to disappear. This should no longer happen.