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,47 +2376,56 @@ bool CPlayer::SetAreaPlayerHint(const CScriptPlayerHint& hint, CStateManager& mg
} }
void CPlayer::AddToPlayerHintRemoveList(TUniqueId id, CStateManager& mgr) { void CPlayer::AddToPlayerHintRemoveList(TUniqueId id, CStateManager& mgr) {
if (const TCastToConstPtr<CScriptPlayerHint> hint = mgr.ObjectById(id)) { const TCastToConstPtr<CScriptPlayerHint> hint = mgr.ObjectById(id);
for (const TUniqueId existId : x93c_playerHintsToRemove) { if (!hint) {
if (id == existId) { return;
return; }
}
}
if (x93c_playerHintsToRemove.size() != 32) { for (const TUniqueId existId : x93c_playerHintsToRemove) {
x93c_playerHintsToRemove.push_back(id); if (id == existId) {
return;
} }
} }
if (x93c_playerHintsToRemove.size() != 32) {
x93c_playerHintsToRemove.push_back(id);
}
} }
void CPlayer::AddToPlayerHintAddList(TUniqueId id, CStateManager& mgr) { void CPlayer::AddToPlayerHintAddList(TUniqueId id, CStateManager& mgr) {
if (const TCastToConstPtr<CScriptPlayerHint> hint = mgr.ObjectById(id)) { const TCastToConstPtr<CScriptPlayerHint> hint = mgr.ObjectById(id);
for (const TUniqueId existId : x980_playerHintsToAdd) { if (!hint) {
if (id == existId) { return;
return; }
}
}
if (x980_playerHintsToAdd.size() != 32) { for (const TUniqueId existId : x980_playerHintsToAdd) {
x980_playerHintsToAdd.push_back(id); if (id == existId) {
return;
} }
} }
if (x980_playerHintsToAdd.size() != 32) {
x980_playerHintsToAdd.push_back(id);
}
} }
void CPlayer::DeactivatePlayerHint(TUniqueId id, CStateManager& mgr) { void CPlayer::DeactivatePlayerHint(TUniqueId id, CStateManager& mgr) {
if (TCastToPtr<CScriptPlayerHint> hint = mgr.ObjectById(id)) { const TCastToPtr<CScriptPlayerHint> hint = mgr.ObjectById(id);
for (const TUniqueId existId : x93c_playerHintsToRemove) { if (!hint) {
if (id == existId) { return;
return; }
}
}
if (x93c_playerHintsToRemove.size() != 32) { for (const TUniqueId existId : x93c_playerHintsToRemove) {
x93c_playerHintsToRemove.push_back(id); if (id == existId) {
hint->ClearObjectList(); return;
hint->SetDeactivated();
} }
} }
if (x93c_playerHintsToRemove.size() != 32) {
x93c_playerHintsToRemove.push_back(id);
hint->ClearObjectList();
hint->SetDeactivated();
}
} }
void CPlayer::UpdatePlayerHints(CStateManager& mgr) { void CPlayer::UpdatePlayerHints(CStateManager& mgr) {
@ -3233,7 +3242,9 @@ void CPlayer::UpdateGunTransform(const zeus::CVector3f& gunPos, CStateManager& m
void CPlayer::UpdateAssistedAiming(const zeus::CTransform& xf, const CStateManager& mgr) { void CPlayer::UpdateAssistedAiming(const zeus::CTransform& xf, const CStateManager& mgr) {
zeus::CTransform assistXf = xf; 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 gunToTarget = x480_assistedTargetAim - xf.origin;
zeus::CVector3f gunToTargetFlat = gunToTarget; zeus::CVector3f gunToTargetFlat = gunToTarget;
gunToTargetFlat.z() = 0.f; gunToTargetFlat.z() = 0.f;
@ -4646,7 +4657,7 @@ void CPlayer::UpdateOrbitInput(const CFinalInput& input, CStateManager& mgr) {
} }
break; break;
case EPlayerOrbitState::OrbitObject: case EPlayerOrbitState::OrbitObject:
if (const TCastToConstPtr<CScriptGrapplePoint> point = mgr.GetObjectById(x310_orbitTargetId)) { if (TCastToConstPtr<CScriptGrapplePoint>(mgr.GetObjectById(x310_orbitTargetId))) {
if (ValidateCurrentOrbitTargetId(mgr) == EOrbitValidationResult::OK) { if (ValidateCurrentOrbitTargetId(mgr) == EOrbitValidationResult::OK) {
UpdateOrbitPosition(g_tweakPlayer->GetOrbitNormalDistance(int(x308_orbitType)), mgr); UpdateOrbitPosition(g_tweakPlayer->GetOrbitNormalDistance(int(x308_orbitType)), mgr);
} else { } else {
@ -4729,7 +4740,7 @@ void CPlayer::UpdateOrbitInput(const CFinalInput& input, CStateManager& mgr) {
case EPlayerOrbitState::NoOrbit: case EPlayerOrbitState::NoOrbit:
break; break;
case EPlayerOrbitState::OrbitObject: case EPlayerOrbitState::OrbitObject:
if (TCastToConstPtr<CScriptGrapplePoint> point = mgr.GetObjectById(x310_orbitTargetId)) { if (TCastToConstPtr<CScriptGrapplePoint>(mgr.GetObjectById(x310_orbitTargetId))) {
BreakGrapple(EPlayerOrbitRequest::Default, mgr); BreakGrapple(EPlayerOrbitRequest::Default, mgr);
} else { } else {
SetOrbitRequest(EPlayerOrbitRequest::StopOrbit, mgr); SetOrbitRequest(EPlayerOrbitRequest::StopOrbit, mgr);