I don't even agree with myself on that one and I am pretty much indifferent to anything that is cosmetic. At the end of the day, eclipse auto formats my code anyway so I have no choice but to go with the eclipse default.
if (test() && (a + b) / d > c) {
code;
}
Order of operations is a weakness of mine for some reason, so I would totally add more parenthesis to that and just about everything. I'll even put that on new lines.. just so I don't screw up.
NO!!!
I must have wrote that drunk.. I was looking for an example of my crazy parenthesis usage and I found this... oh kill me.
// Make sure none of the dwarfs are about to cut this down
int abort = 0;
for (uint32_t i = 0; i < busy.size(); i++)
{
if ((busy[i]->x == tree.x) && (busy[i]->y == tree.y) && (busy[i]->z == tree.z))
{
abort = 1;
break;
}
} if (abort == 1) continue;
Oh well, can't win them all. I talk shit and end up making a fool of myself. Guess I have to spite myself too or something.
Anyway, off to hang with my daughter. We need to chat more.
EDIT: Oh wait, I remember... I was up late tired trying to track down a bug... Dwarf Foreman was causing my game to throw "Urist cancels dig: invalid designation" or "Urist cancels cut tree" or something like that and I couldn't figure it out.
It turns out that when a dwarf goes to cut down a tree, the designation to be cut is removed. So Foreman saw the tree as not being cut down so it redesigned it to be cut. A dwarf would go there to cut it down when it was already being cut and it already be gone or in the process of being cut down. The tile designation for cutting a tree, gathing a plant, or digging a tile is the same so that explained the different errors. So you have to iterate through all the dwarfs, see who is cutting a tree, and store it than when you iterate through the trees ignore any that are already being cut. I was tired and wanted to go to bed badly
That is my excuse and I am sticking with it