Reticle target sensitive, in precise mode, should allow for weapon offset

This commit is contained in:
cim 2013-11-10 10:27:01 +00:00
parent 4ae7092aa3
commit 531e674a91

View File

@ -5312,31 +5312,38 @@ static BOOL MaintainLinkedLists(Universe *uni)
- (Entity *) firstEntityTargetedByPlayerPrecisely - (Entity *) firstEntityTargetedByPlayerPrecisely
{ {
OOWeaponFacing targetFacing; OOWeaponFacing targetFacing;
Vector laserPortOffset = kZeroVector;
PlayerEntity *player = PLAYER;
switch (viewDirection) switch (viewDirection)
{ {
case VIEW_FORWARD: case VIEW_FORWARD:
targetFacing = WEAPON_FACING_FORWARD; targetFacing = WEAPON_FACING_FORWARD;
laserPortOffset = [player forwardWeaponOffset];
break; break;
case VIEW_AFT: case VIEW_AFT:
targetFacing = WEAPON_FACING_AFT; targetFacing = WEAPON_FACING_AFT;
laserPortOffset = [player aftWeaponOffset];
break; break;
case VIEW_PORT: case VIEW_PORT:
targetFacing = WEAPON_FACING_PORT; targetFacing = WEAPON_FACING_PORT;
laserPortOffset = [player portWeaponOffset];
break; break;
case VIEW_STARBOARD: case VIEW_STARBOARD:
targetFacing = WEAPON_FACING_STARBOARD; targetFacing = WEAPON_FACING_STARBOARD;
laserPortOffset = [player starboardWeaponOffset];
break; break;
default: default:
// Match behaviour of -firstEntityTargetedByPlayer. // Match behaviour of -firstEntityTargetedByPlayer.
targetFacing = WEAPON_FACING_FORWARD; targetFacing = WEAPON_FACING_FORWARD;
laserPortOffset = [player forwardWeaponOffset];
} }
return [self firstShipHitByLaserFromShip:PLAYER inDirection:targetFacing offset:kZeroVector gettingRangeFound:NULL]; return [self firstShipHitByLaserFromShip:PLAYER inDirection:targetFacing offset:laserPortOffset gettingRangeFound:NULL];
} }