Skip to content

Commit 3cf9d1f

Browse files
authored
Merge pull request #1750 from Sir-Skurpsalot/Sir-Skurpsalot-player-patch-1
Sir skurpsalot player patch 1
2 parents 3661499 + 66a6c3d commit 3cf9d1f

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

Engine/source/T3D/player.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,19 +1015,19 @@ void PlayerData::initPersistFields()
10151015
"Used when computing the damage location.\n"
10161016
"@see Player::getDamageLocation" );
10171017
addFieldV( "boxTorsoLeftPercentage", TypeRangedF32, Offset(boxTorsoLeftPercentage, PlayerData), &CommonValidators::NormalizedFloat,
1018-
"@brief Percentage of the player's bounding box width that represents the left side of the torso.\n\n"
1018+
"@brief Percentage of the player's bounding box width from center that represents the left side of the torso.\n\n"
10191019
"Used when computing the damage location.\n"
10201020
"@see Player::getDamageLocation" );
10211021
addFieldV( "boxTorsoRightPercentage", TypeRangedF32, Offset(boxTorsoRightPercentage, PlayerData), &CommonValidators::NormalizedFloat,
1022-
"@brief Percentage of the player's bounding box width that represents the right side of the torso.\n\n"
1022+
"@brief Percentage of the player's bounding box width from center that represents the right side of the torso.\n\n"
10231023
"Used when computing the damage location.\n"
10241024
"@see Player::getDamageLocation" );
10251025
addFieldV( "boxTorsoBackPercentage", TypeRangedF32, Offset(boxTorsoBackPercentage, PlayerData), &CommonValidators::NormalizedFloat,
1026-
"@brief Percentage of the player's bounding box depth that represents the back side of the torso.\n\n"
1026+
"@brief Percentage of the player's bounding box depth from center that represents the back side of the torso.\n\n"
10271027
"Used when computing the damage location.\n"
10281028
"@see Player::getDamageLocation" );
10291029
addFieldV( "boxTorsoFrontPercentage", TypeRangedF32, Offset(boxTorsoFrontPercentage, PlayerData), &CommonValidators::NormalizedFloat,
1030-
"@brief Percentage of the player's bounding box depth that represents the front side of the torso.\n\n"
1030+
"@brief Percentage of the player's bounding box depth from center that represents the front side of the torso.\n\n"
10311031
"Used when computing the damage location.\n"
10321032
"@see Player::getDamageLocation" );
10331033

@@ -2395,10 +2395,10 @@ void Player::getDamageLocation(const Point3F& in_rPos, const char *&out_rpVert,
23952395
{
23962396
F32 xWidth = boxSize.x;
23972397

2398-
//boxTorsoBackPercentage and boxTorsoLeftPercentage should both be negative floats
2399-
F32 backPoint = yLength * mDataBlock->boxTorsoBackPercentage;
2398+
//boxTorsoBackPercentage and boxTorsoLeftPercentage need to be flipped negative
2399+
F32 backPoint = (yLength * mDataBlock->boxTorsoBackPercentage) * -1.0f;
24002400
F32 frontPoint = yLength * mDataBlock->boxTorsoFrontPercentage;
2401-
F32 leftPoint = xWidth * mDataBlock->boxTorsoLeftPercentage;
2401+
F32 leftPoint = (xWidth * mDataBlock->boxTorsoLeftPercentage) * -1.0f;
24022402
F32 rightPoint = xWidth * mDataBlock->boxTorsoRightPercentage;
24032403

24042404
S32 index = 0; //Middle hits are cases 0-2

0 commit comments

Comments
 (0)