For some reason the moron that wrote the engine has a convention of using returns instead of breaks...and since the function is a boolean, I thought it easier to just follow that instead of setting a flag and returning the appropriate boolean from inside the switch. I put an update function outside of the switch, and the code never saw it because of the returns inside of the switch.
Comments 5
Reply
Reply
boolean function OnKey
{
switch (key)
{
case:
return true
case:
x+=2;
return true
}
a(x)
return false;
}
See the response to arichi as to why it is set up that way.
Reply
For some reason the moron that wrote the engine has a convention of using returns instead of breaks...and since the function is a boolean, I thought it easier to just follow that instead of setting a flag and returning the appropriate boolean from inside the switch. I put an update function outside of the switch, and the code never saw it because of the returns inside of the switch.
Reply
Leave a comment