Re: Sphere 1.5, 1.6 beta
Reply #90 –
Believe me, I am very thankful for this. I reverse-engineered a lot of stuff through playtesting, but there were some things, like zone handling, that required a read of the source. If the original source weren't as clean as it is, minisphere 1.0 would still probably be in alpha. 
Nonetheless, some of the algorithms used in it are pretty dumb, like reading strings from a file one character at a time or similar nonsense. It also violates DRY a lot. This, for example, happens way too often:
if (!m_Engine->IsScriptBeingUsed(m_DefaultMapScripts[which]))
{
std::string error;
if (!ExecuteScript(m_DefaultMapScripts[which], error))
{
m_ErrorMessage = "Could not execute default " + list[which] + " map script\n" + error;
return false;
}
}
In minisphere, that functionality is centralized in script.c, so from outside all you see is run_script(s_update_script, false);, which makes the intent much clearer and cuts down on the boilerplate.