Remove roundstart runtimes
Created by: wild-billy
Having runtimes on roundstart is pretty sad so I fixed them N2O floors were simple, added a check so they don't try to dick with their non-existent air datum The others were more interesting and warrant some explanation so hopefully they don't happen again.
tl;dr turfs are changelings, mob code is garbage, and people think its ok to avoid fixing runtimes for a year
Mining turfs' New()
was calling one of their procs after a spawn()
.
The problem is, during that spawn, they were actually getting deleted and replaced with a different turf (a mining room turf, a /simulated/wall
instead of an /unsimulated/floor
).
When turfs get deleted, their running procs aren't killed or have src
set to null.
Instead, the procs' src
is set to the new turf and they continue running like nothing's wrong.
After coming back from the spawn()
, New()
was trying to call one of its turf's procs, only to find that it had been replaced by an impostor! spawn()
(which was added in https://github.com/d3athrow/vgstation13/commit/52c900520ccc390afc9056c1109b8745317b1a62 in 2011 with no explanation of course :trollface:)
Humans' New()
was calling their set_species()
, which was very crappy.
It was crashing due to a runtime when the space russian corpse was created and attempted to get a species from the global list.
Problem is, it was initializing before /world
, and /world/New()
actually builds its species list.
Easily fixed. But now the server didn't even start.
That's because the runtime in set_species()
was causing New()
to crash before finishing.
When New()
didn't crash, it went on to call a proc that eventually attempted to divide by zero.
That's because it was dividing by a value it got from a global list. An uninitialized global list.