It doesn't seem to be obeying the laws any other programming language should, such as only doing commands in if statements if the statement is met. Let me give you an example:
function GameConnection::spawnPlayer(%Client)
{
echo("SpawnHit");
parent::spawnPlayer(%Client);
%basePlayerSpeed = %client.player.getDatablock().maxForwardSpeed;
%randNum = getRandom(0,1);
echo(%randNum);
echo("SpawnParentPassed");
if(%randNum == 1){
echo("if hit");
changeSpeed(%client, 30);
messageAll('BoostSoundEmitter','\c1%1 recieved boost', %client.name);
ServerPlay2D(boostSound);
}
}
It will go through, hitting the echos properly. But sometimes, for some reason, it only does half the commands. For example, my echos tell me that the if was hit, and I get the chat message, but then I get no speed boost or sound. Then on another occasion my echos report that the if statement wasn't hit, but the sound plays anyway. Sometimes none of the if commands happen upon hit, sometimes all. I'll just clarify some things I've tried:
-This is properly packaged and activated. All the other function overwrites work just dandy as far as I've seen.
-changeSpeed, messageAll, and ServerPlay2D have all worked just fine in their current states, but often just seem to choose not to at random times for no reason
The first thing you'll probably think is that I'm making some sort of pathetic joke. But I'm not. I have tried over and over again and nothing is working. I've shown the code to Jetz and he confirmed that it should work fine. I just don't know what's going on. Is there some small thing I'm doing that I've been missing all this time? Or does Torque just hate me?