CPlayer: Resolve unused variable warnings

This commit is contained in:
Lioncash 2020-05-09 22:35:53 -04:00
parent f7ce3f2133
commit ec79a9de89
1 changed files with 40 additions and 29 deletions

View File

@ -2376,7 +2376,11 @@ bool CPlayer::SetAreaPlayerHint(const CScriptPlayerHint& hint, CStateManager& mg
}
void CPlayer::AddToPlayerHintRemoveList(TUniqueId id, CStateManager& mgr) {
if (const TCastToConstPtr<CScriptPlayerHint> hint = mgr.ObjectById(id)) {
const TCastToConstPtr<CScriptPlayerHint> hint = mgr.ObjectById(id);
if (!hint) {
return;
}
for (const TUniqueId existId : x93c_playerHintsToRemove) {
if (id == existId) {
return;
@ -2387,10 +2391,13 @@ void CPlayer::AddToPlayerHintRemoveList(TUniqueId id, CStateManager& mgr) {
x93c_playerHintsToRemove.push_back(id);
}
}
}
void CPlayer::AddToPlayerHintAddList(TUniqueId id, CStateManager& mgr) {
if (const TCastToConstPtr<CScriptPlayerHint> hint = mgr.ObjectById(id)) {
const TCastToConstPtr<CScriptPlayerHint> hint = mgr.ObjectById(id);
if (!hint) {
return;
}
for (const TUniqueId existId : x980_playerHintsToAdd) {
if (id == existId) {
return;
@ -2401,10 +2408,13 @@ void CPlayer::AddToPlayerHintAddList(TUniqueId id, CStateManager& mgr) {
x980_playerHintsToAdd.push_back(id);
}
}
}
void CPlayer::DeactivatePlayerHint(TUniqueId id, CStateManager& mgr) {
if (TCastToPtr<CScriptPlayerHint> hint = mgr.ObjectById(id)) {
const TCastToPtr<CScriptPlayerHint> hint = mgr.ObjectById(id);
if (!hint) {
return;
}
for (const TUniqueId existId : x93c_playerHintsToRemove) {
if (id == existId) {
return;
@ -2417,7 +2427,6 @@ void CPlayer::DeactivatePlayerHint(TUniqueId id, CStateManager& mgr) {
hint->SetDeactivated();
}
}
}
void CPlayer::UpdatePlayerHints(CStateManager& mgr) {
bool removedHint = false;
@ -3233,7 +3242,9 @@ void CPlayer::UpdateGunTransform(const zeus::CVector3f& gunPos, CStateManager& m
void CPlayer::UpdateAssistedAiming(const zeus::CTransform& xf, const CStateManager& mgr) {
zeus::CTransform assistXf = xf;
if (TCastToConstPtr<CActor> target = mgr.GetObjectById(x3f4_aimTarget)) {
const TCastToConstPtr<CActor> target = mgr.GetObjectById(x3f4_aimTarget);
if (target) {
zeus::CVector3f gunToTarget = x480_assistedTargetAim - xf.origin;
zeus::CVector3f gunToTargetFlat = gunToTarget;
gunToTargetFlat.z() = 0.f;
@ -4646,7 +4657,7 @@ void CPlayer::UpdateOrbitInput(const CFinalInput& input, CStateManager& mgr) {
}
break;
case EPlayerOrbitState::OrbitObject:
if (const TCastToConstPtr<CScriptGrapplePoint> point = mgr.GetObjectById(x310_orbitTargetId)) {
if (TCastToConstPtr<CScriptGrapplePoint>(mgr.GetObjectById(x310_orbitTargetId))) {
if (ValidateCurrentOrbitTargetId(mgr) == EOrbitValidationResult::OK) {
UpdateOrbitPosition(g_tweakPlayer->GetOrbitNormalDistance(int(x308_orbitType)), mgr);
} else {
@ -4729,7 +4740,7 @@ void CPlayer::UpdateOrbitInput(const CFinalInput& input, CStateManager& mgr) {
case EPlayerOrbitState::NoOrbit:
break;
case EPlayerOrbitState::OrbitObject:
if (TCastToConstPtr<CScriptGrapplePoint> point = mgr.GetObjectById(x310_orbitTargetId)) {
if (TCastToConstPtr<CScriptGrapplePoint>(mgr.GetObjectById(x310_orbitTargetId))) {
BreakGrapple(EPlayerOrbitRequest::Default, mgr);
} else {
SetOrbitRequest(EPlayerOrbitRequest::StopOrbit, mgr);