fix CalcModelFrame/SetBone/GetBone/SetAnimation not grabbing smf from modeldata for decoupled anims
This commit is contained in:
parent
b61941b4a6
commit
4bdc3ee28d
2 changed files with 11 additions and 7 deletions
|
|
@ -5133,7 +5133,9 @@ FModel * SetGetBoneShared(AActor * self, int model_index)
|
|||
ThrowAbortException(X_OTHER, isSet ? "Cannot set bone offset for non-decoupled actors" : (isOffset ? "Cannot get bone for non-decoupled actors" : "Cannot get bone offset for non-decoupled actors"));
|
||||
}
|
||||
|
||||
if(!BaseSpriteModelFrames.CheckKey(self->GetClass()))
|
||||
auto smf_class = (self->modelData && self->modelData->modelDef) ? self->modelData->modelDef : self->GetClass();
|
||||
|
||||
if(!BaseSpriteModelFrames.CheckKey(smf_class))
|
||||
{
|
||||
ThrowAbortException(X_OTHER, "Actor class is missing a MODELDEF definition or a MODELDEF BaseFrame");
|
||||
}
|
||||
|
|
@ -5144,9 +5146,9 @@ FModel * SetGetBoneShared(AActor * self, int model_index)
|
|||
{
|
||||
return Models[self->modelData->models[model_index].modelID];
|
||||
}
|
||||
else if(BaseSpriteModelFrames[self->GetClass()].modelIDs.SSize() > model_index)
|
||||
else if(BaseSpriteModelFrames[smf_class].modelIDs.SSize() > model_index)
|
||||
{
|
||||
return Models[BaseSpriteModelFrames[self->GetClass()].modelIDs[model_index]];
|
||||
return Models[BaseSpriteModelFrames[smf_class].modelIDs[model_index]];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -6193,7 +6195,9 @@ void SetAnimationInternal(AActor * self, FName animName, double framerate, int s
|
|||
ThrowAbortException(X_OTHER, "Cannot set animation for non-decoupled actors");
|
||||
}
|
||||
|
||||
if(!BaseSpriteModelFrames.CheckKey(self->GetClass()))
|
||||
auto smf_class = (self->modelData && self->modelData->modelDef) ? self->modelData->modelDef : self->GetClass();
|
||||
|
||||
if(!BaseSpriteModelFrames.CheckKey(smf_class))
|
||||
{
|
||||
ThrowAbortException(X_OTHER, "Actor class is missing a MODELDEF definition or a MODELDEF BaseFrame");
|
||||
}
|
||||
|
|
@ -6227,7 +6231,7 @@ void SetAnimationInternal(AActor * self, FName animName, double framerate, int s
|
|||
}
|
||||
else
|
||||
{
|
||||
animID = BaseSpriteModelFrames[self->GetClass()].animationIDs[0];
|
||||
animID = BaseSpriteModelFrames[smf_class].animationIDs[0];
|
||||
}
|
||||
|
||||
FModel * animation = nullptr;
|
||||
|
|
@ -6241,7 +6245,7 @@ void SetAnimationInternal(AActor * self, FName animName, double framerate, int s
|
|||
}
|
||||
else
|
||||
{
|
||||
animation = Models[BaseSpriteModelFrames[self->GetClass()].modelIDs[0]];
|
||||
animation = Models[BaseSpriteModelFrames[smf_class].modelIDs[0]];
|
||||
}
|
||||
|
||||
int animStart = animation->FindFirstFrame(animName);
|
||||
|
|
|
|||
|
|
@ -384,7 +384,7 @@ CalcModelFrameInfo CalcModelFrame(FLevelLocals *Level, const FSpriteModelFrame *
|
|||
|
||||
if(is_decoupled)
|
||||
{
|
||||
smfNext = smf = &BaseSpriteModelFrames[actor->GetClass()];
|
||||
smfNext = smf = &BaseSpriteModelFrames[(data != nullptr && data->modelDef != nullptr) ? data->modelDef : actor->GetClass()];
|
||||
if(data && !(data->curAnim.flags & MODELANIM_NONE))
|
||||
{
|
||||
calcFrames(data->curAnim, tic, decoupled_frame, inter);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue