Bug #860 fix, but disabled

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2523 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
avolkov
2006-11-23 18:05:39 +00:00
parent 30e4761d07
commit 549f114bd5
+22 -3
View File
@@ -323,7 +323,8 @@ chmmr_postprocess (PELEMENT ElementPtr)
LockElement (ElementPtr->hTarget, &ShipElementPtr); LockElement (ElementPtr->hTarget, &ShipElementPtr);
ProcessSound (SetAbsSoundIndex ( ProcessSound (SetAbsSoundIndex (
StarShipPtr->RaceDescPtr->ship_data.ship_sounds, 1), ShipElementPtr); StarShipPtr->RaceDescPtr->ship_data.ship_sounds, 1),
ShipElementPtr);
UnlockElement (ElementPtr->hTarget); UnlockElement (ElementPtr->hTarget);
@@ -340,7 +341,7 @@ chmmr_postprocess (PELEMENT ElementPtr)
SIZE i, dx, dy; SIZE i, dx, dy;
COUNT angle, magnitude; COUNT angle, magnitude;
STARSHIPPTR EnemyStarShipPtr; STARSHIPPTR EnemyStarShipPtr;
SIZE shadow_offs[] = static const SIZE shadow_offs[] =
{ {
DISPLAY_TO_WORLD (8), DISPLAY_TO_WORLD (8),
DISPLAY_TO_WORLD (8 + 9), DISPLAY_TO_WORLD (8 + 9),
@@ -356,8 +357,9 @@ chmmr_postprocess (PELEMENT ElementPtr)
BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x09), 0x56), BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x09), 0x56),
BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x07), 0x57), BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x07), 0x57),
}; };
DWORD current_speed, max_speed;
// calculate tractor beam effect
angle = FACING_TO_ANGLE (StarShipPtr->ShipFacing); angle = FACING_TO_ANGLE (StarShipPtr->ShipFacing);
dx = (ElementPtr->next.location.x dx = (ElementPtr->next.location.x
+ COSINE (angle, (LASER_RANGE / 3) + COSINE (angle, (LASER_RANGE / 3)
@@ -375,6 +377,23 @@ chmmr_postprocess (PELEMENT ElementPtr)
GetCurrentVelocityComponents (&ShipElementPtr->velocity, GetCurrentVelocityComponents (&ShipElementPtr->velocity,
&dx, &dy); &dx, &dy);
GetElementStarShip (ShipElementPtr, &EnemyStarShipPtr); GetElementStarShip (ShipElementPtr, &EnemyStarShipPtr);
#ifdef BUG_860_FIX
// set the effected ship's speed flags
current_speed = VelocitySquared (dx, dy);
max_speed = VelocitySquared (WORLD_TO_VELOCITY (
EnemyStarShipPtr->RaceDescPtr->characteristics.max_thrust),
0);
EnemyStarShipPtr->cur_status_flags &= ~(SHIP_AT_MAX_SPEED
| SHIP_BEYOND_MAX_SPEED);
if (current_speed > max_speed)
EnemyStarShipPtr->cur_status_flags |= (SHIP_AT_MAX_SPEED
| SHIP_BEYOND_MAX_SPEED);
else if (current_speed == max_speed)
EnemyStarShipPtr->cur_status_flags |= SHIP_AT_MAX_SPEED;
#endif // BUG_860_FIX
// add tractor beam graphical effects
for (i = 0; i < NUM_SHADOWS; ++i) for (i = 0; i < NUM_SHADOWS; ++i)
{ {
HELEMENT hShadow; HELEMENT hShadow;