I was looking at the Assembly-CSharp.dll trying to understand how zombie pathing is determined (Haidrgna does this thing in GNAMOD where the zombies do a zigzag while chasing you and it gave me some ideas...) and I immediately noticed a ton of what appear to be infinite loops build into the game code. For example:
You've got a while(true), which would loop forever (ignoring the unnecessary switch clause). I was wondering if any other modders noticed this and if it's common in game code? I know most programs have limiters which prevent infinite loops from running forever and causing issues, but that's still an extra routine that has to run and like I said, I see them everywhere. Could this be causing some of the lag issues within the game? And might it be worth creating a mod that cleans this up?...
Code:
if (!RZ)
{
while (true)
{
switch (2)
{
default:
return;
case 0:
break;
}
}
}