@@ -3246,16 +3246,13 @@ static void drawStructureSelections( void )
32463246 /* Go thru' all the buildings */
32473247 for (psStruct = apsStructLists [selectedPlayer ]; psStruct ; psStruct = psStruct -> psNext )
32483248 {
3249- if (clipXY (psStruct -> pos .x ,psStruct -> pos .y ))
3249+ if (clipXY (psStruct -> pos .x ,psStruct -> pos .y ) && psStruct -> sDisplay . frameNumber == currentGameFrame )
32503250 {
32513251 /* If it's selected */
3252- if (psStruct -> selected
3253- || (barMode == BAR_DROIDS_AND_STRUCTURES
3254- && (psStruct -> pStructureType -> type != REF_WALL && psStruct -> pStructureType -> type != REF_WALLCORNER ))
3255- || (bMouseOverOwnStructure
3256- && psStruct == (STRUCTURE * ) psClickedOn
3257- && ((STRUCTURE * )psClickedOn )-> status == SS_BUILT
3258- && psStruct -> sDisplay .frameNumber == currentGameFrame ))
3252+ if (psStruct -> selected ||
3253+ (barMode == BAR_DROIDS_AND_STRUCTURES && psStruct -> pStructureType -> type != REF_WALL && psStruct -> pStructureType -> type != REF_WALLCORNER ) ||
3254+ (bMouseOverOwnStructure && psStruct == (STRUCTURE * )psClickedOn )
3255+ )
32593256 {
32603257 drawStructureHealth (psStruct );
32613258
@@ -3264,12 +3261,10 @@ static void drawStructureSelections( void )
32643261 drawWeaponReloadBar ((BASE_OBJECT * )psStruct , & psStruct -> asWeaps [i ], i );
32653262 }
32663263 }
3267- else
3264+
3265+ if (psStruct -> status == SS_BEING_BUILT )
32683266 {
3269- if (psStruct -> status == SS_BEING_BUILT && psStruct -> sDisplay .frameNumber == currentGameFrame )
3270- {
3271- drawStructureBuildProgress (psStruct );
3272- }
3267+ drawStructureBuildProgress (psStruct );
32733268 }
32743269 }
32753270 }
@@ -3407,12 +3402,19 @@ static void drawDroidSelections( void )
34073402 pie_SetFogStatus (false);
34083403 for (psDroid = apsDroidLists [selectedPlayer ]; psDroid ; psDroid = psDroid -> psNext )
34093404 {
3405+ if (psDroid -> sDisplay .frameNumber != currentGameFrame || !clipXY (psDroid -> pos .x , psDroid -> pos .y ))
3406+ {
3407+ continue ; // Not visible, anyway. Don't bother with health bars.
3408+ }
3409+
34103410 /* If it's selected and on screen or it's the one the mouse is over ||*/
34113411 // ABSOLUTELY MAD LOGICAL EXPRESSION!!! :-)
3412- if ((eitherSelected (psDroid ) && psDroid -> sDisplay .frameNumber == currentGameFrame )
3413- || (bMouseOverOwnDroid && psDroid == (DROID * ) psClickedOn )
3414- || (droidUnderRepair (psDroid ) && psDroid -> sDisplay .frameNumber == currentGameFrame )
3415- || (barMode == BAR_DROIDS || barMode == BAR_DROIDS_AND_STRUCTURES ))
3412+ // Now slightly less mad and slightly less buggy.
3413+ if (eitherSelected (psDroid ) ||
3414+ (bMouseOverOwnDroid && psDroid == (DROID * ) psClickedOn ) ||
3415+ droidUnderRepair (psDroid ) ||
3416+ barMode == BAR_DROIDS || barMode == BAR_DROIDS_AND_STRUCTURES
3417+ )
34163418 {
34173419 damage = PERCENT (psDroid -> body , psDroid -> originalBody );
34183420
0 commit comments