From 0bcbf27b212138802ed703e5abd37c67f41a6860 Mon Sep 17 00:00:00 2001 From: Giel van Schijndel Date: Thu, 16 Oct 2008 13:22:02 +0000 Subject: [PATCH] * Use "if (!condition) { action }" instead of "if (condition) { /* Nothing */ } else { action }" * Use proper indenting/style git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6176 4a71c877-e1ca-e34f-864e-861f7616d084 --- src/hci.c | 13 ++++++------- src/scriptai.c | 3 ++- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/hci.c b/src/hci.c index 0d6a14d73..8e4407f84 100644 --- a/src/hci.c +++ b/src/hci.c @@ -1966,9 +1966,8 @@ INT_RETVAL intRunWidgets(void) structX2 = world_coord(structX2) + TILE_UNITS / 2; structY2 = world_coord(structY2) + TILE_UNITS / 2; - if(IsPlayerStructureLimitReached(selectedPlayer)) { - /* Nothing */ - } else { + if (!IsPlayerStructureLimitReached(selectedPlayer)) + { // Set the droid order if (intNumSelectedDroids(DROID_CONSTRUCT) == 0 && intNumSelectedDroids(DROID_CYBORG_CONSTRUCT) == 0 @@ -2024,10 +2023,10 @@ INT_RETVAL intRunWidgets(void) } } - if(CanBuild) { - if(IsPlayerStructureLimitReached(selectedPlayer)) { - - } else { + if (CanBuild) + { + if (!IsPlayerStructureLimitReached(selectedPlayer)) + { // Set the droid order if (intNumSelectedDroids(DROID_CONSTRUCT) == 0 && intNumSelectedDroids(DROID_CYBORG_CONSTRUCT) == 0 diff --git a/src/scriptai.c b/src/scriptai.c index ee9d6b8c7..1843bed9f 100644 --- a/src/scriptai.c +++ b/src/scriptai.c @@ -651,7 +651,8 @@ BOOL scrOrderDroidStatsLoc(void) // Don't allow scripts to order structure builds if players structure // limit has been reached. - if(IsPlayerStructureLimitReached(psDroid->player) == false) { + if (!IsPlayerStructureLimitReached(psDroid->player)) + { orderDroidStatsLoc(psDroid, order, psStats, (UDWORD)x,(UDWORD)y); }