You've changed some bits that aren't related to the pmap to use PS and TYPE. I haven't checked through all of it, but here's the stuff I noticed: http://pastebin.com/JAAT00F5
im still having above issue.(my only current problem is that sometimes when something freezes or melts a whole lot of ranomdo particles and walls explode from it, it also crashes frequently when lighting explosives or setting explosives off)