Crude fwd port of https://github.com/slash2009/XWMM/pull/16

It basically syncs master/frodo

If this breaks anything ill be dammed cause idk how to fix it.