pImage->ecm = abs( pImage->ecm ); commented out of unit_generic.cpp
There's a couple of if(return target->GetImageInformation().ecm>0){... in cockpit.cpp and vdu.cpp, which
might lead the reader to assume it could be less than zero.
Maybe they should be changed to if(return target->GetImageInformation().ecm!=0){...
In vdu.cpp there's also this:
Code: Select all
if (print_ecm) {
if (parent->GetImageInformation().ecm > 0) {
GFXColor4f( 0, 1, 0, .5 );
strcpy( ecmstatus, "ECM Active" );
}
if ( ( (parent->GetImageInformation().ecm < 0) ) ) {
GFXColor4f( .6, .6, .6, .5 );
strcpy( ecmstatus, "ECM Inactive" );
}
if (parent->GetImageInformation().ecm > 0) {
static float s = 0;
s += .125*SIMULATION_ATOM;
if (s > 1)
s = 0;
DrawShield( 0, s, s, 0, x, y, w, h, false, GFXColor( 0, 1, 0 ), GFXColor( 0, .75, 0 ), GFXColor( 0, .5, 0 ) );
}
}
which I guess could be simplified to,
Code: Select all
if (print_ecm) {
if (parent->GetImageInformation().ecm != 0) {
GFXColor4f( 0, 1, 0, .5 );
strcpy( ecmstatus, "ECM Active" );
static float s = 0;
s += .125*SIMULATION_ATOM;
if (s > 1)
s = 0;
DrawShield( 0, s, s, 0, x, y, w, h, false, GFXColor( 0, 1, 0 ), GFXColor( 0, .75, 0 ), GFXColor( 0, .5, 0 ) );
}
}
In cockpit.cpp there's a case in a switch statement,
Code: Select all
case UnitImages< void >::ECM_MODAL:
if (target->GetImageInformation().ecm < 0)
return (float) UnitImages< void >::READY;
else if (target->GetImageInformation().ecm > 0)
return (float) UnitImages< void >::ACTIVE;
else
return (float) UnitImages< void >::NOTAPPLICABLE;
Maybe ecm<0 should return NOTAPPLICABLE instead of READY? Changing to...
Code: Select all
case UnitImages< void >::ECM_MODAL:
if (target->GetImageInformation().ecm != 0)
return (float) UnitImages< void >::ACTIVE;
else
return (float) UnitImages< void >::NOTAPPLICABLE;
I'll commit this to the reformat branch for now.