Initial commit from https://stw.codeplex.com/SourceControl/network/forks/dodexahedron/STWRevival/changeset/cd375bb72fd36a9ac7cf8a5b989b6148c60a4ff0