mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 07:07:42 +00:00
CBodyState: Eliminate usages of const_cast
This is clearly modifying the command, so we should allow for modifying of command instances if necessary.
This commit is contained in:
@@ -1120,12 +1120,14 @@ pas::EAnimationState CBSHurled::GetBodyStateTransition(float dt, CBodyController
|
||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::NextState)) {
|
||||
return pas::EAnimationState::LieOnGround;
|
||||
}
|
||||
|
||||
if (x18_curTime > 0.25f) {
|
||||
if (const auto* cmd = static_cast<const CBCHurledCmd*>(bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))) {
|
||||
const_cast<CBCHurledCmd*>(cmd)->SetSkipLaunchState(true);
|
||||
if (auto* cmd = static_cast<CBCHurledCmd*>(bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))) {
|
||||
cmd->SetSkipLaunchState(true);
|
||||
return pas::EAnimationState::Hurled;
|
||||
}
|
||||
}
|
||||
|
||||
return pas::EAnimationState::Invalid;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user