Hi Tero and first, thank you for these updates, it keeps my inner child busy while imagining all the potential your endeavors may provoke to the game! Your posts are such a refreshing read
At first, I didn't want to bother you with those, uhm, problems some may encounter by doing what you do and copying your suggestions and improvements, but I decided to test your updates and encountered an error in the code quoted, this line to be specific:
if (sd && !(flag & 1)) {
The 'sd' statement is giving me the compiling error C2065: undeclared identifier in both map-server & map-server-generator projects, which is preventing me from compiling successfully and test those changes.
I'm ashamed to say, while I kind of get the what of the error, I don't know how to successfully fix it since I know very little of source code, so I would like to request your help on how to solve this issue, if you do not mind
Aside from that, please continue working on these fantastic changes and new perspective of things!