Update player.cpp

Fixed validators for damage collision box fields to prevent console whinging
This commit is contained in:
Sir-Skurpsalot 2026-05-23 14:18:03 -06:00 committed by GitHub
parent 3661499b33
commit 40f22dc792
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1005,29 +1005,29 @@ void PlayerData::initPersistFields()
"@brief Collision bounding box used when the player is swimming.\n\n"
"@see boundingBox" );
// Damage collision boxes changed by Skurps
addFieldV( "boxHeadPercentage", TypeRangedF32, Offset(boxHeadPercentage, PlayerData), &CommonValidators::NormalizedFloat,
// Damage collision boxes changed by Skurps
addFieldV( "boxHeadPercentage", TypeRangedF32, Offset(boxHeadPercentage, PlayerData), &CommonValidators::PositiveFloat,
"@brief Percentage of the player's bounding box height that represents the head.\n\n"
"Used when computing the damage location.\n"
"@see Player::getDamageLocation" );
addFieldV( "boxTorsoPercentage", TypeRangedF32, Offset(boxTorsoPercentage, PlayerData), &CommonValidators::NormalizedFloat,
addFieldV( "boxTorsoPercentage", TypeRangedF32, Offset(boxTorsoPercentage, PlayerData), &CommonValidators::PositiveFloat,
"@brief Percentage of the player's bounding box height that represents the torso.\n\n"
"Used when computing the damage location.\n"
"@see Player::getDamageLocation" );
addFieldV( "boxTorsoLeftPercentage", TypeRangedF32, Offset(boxTorsoLeftPercentage, PlayerData), &CommonValidators::NormalizedFloat,
"@brief Percentage of the player's bounding box width that represents the left side of the torso.\n\n"
addFieldV( "boxTorsoLeftPercentage", TypeRangedF32, Offset(boxTorsoLeftPercentage, PlayerData), &CommonValidators::NegDefaultF32,
"@brief Percentage of the player's bounding box width from center that represents the left side of the torso (should be a negative float).\n\n"
"Used when computing the damage location.\n"
"@see Player::getDamageLocation" );
addFieldV( "boxTorsoRightPercentage", TypeRangedF32, Offset(boxTorsoRightPercentage, PlayerData), &CommonValidators::NormalizedFloat,
"@brief Percentage of the player's bounding box width that represents the right side of the torso.\n\n"
addFieldV( "boxTorsoRightPercentage", TypeRangedF32, Offset(boxTorsoRightPercentage, PlayerData), &CommonValidators::PositiveFloat,
"@brief Percentage of the player's bounding box width from center that represents the right side of the torso.\n\n"
"Used when computing the damage location.\n"
"@see Player::getDamageLocation" );
addFieldV( "boxTorsoBackPercentage", TypeRangedF32, Offset(boxTorsoBackPercentage, PlayerData), &CommonValidators::NormalizedFloat,
"@brief Percentage of the player's bounding box depth that represents the back side of the torso.\n\n"
addFieldV( "boxTorsoBackPercentage", TypeRangedF32, Offset(boxTorsoBackPercentage, PlayerData), &CommonValidators::NegDefaultF32,
"@brief Percentage of the player's bounding box depth from center that represents the back side of the torso (should be a negative float).\n\n"
"Used when computing the damage location.\n"
"@see Player::getDamageLocation" );
addFieldV( "boxTorsoFrontPercentage", TypeRangedF32, Offset(boxTorsoFrontPercentage, PlayerData), &CommonValidators::NormalizedFloat,
"@brief Percentage of the player's bounding box depth that represents the front side of the torso.\n\n"
addFieldV( "boxTorsoFrontPercentage", TypeRangedF32, Offset(boxTorsoFrontPercentage, PlayerData), &CommonValidators::PositiveFloat,
"@brief Percentage of the player's bounding box depth from center that represents the front side of the torso.\n\n"
"Used when computing the damage location.\n"
"@see Player::getDamageLocation" );