Don't dealloc if there is no frame in the channel

This commit is contained in:
smallmodel 2024-06-13 21:26:24 +02:00
parent 546ded324e
commit 1d50fa088a
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512

View file

@ -261,15 +261,17 @@ void skelAnimDataGameHeader_s::DeallocAnimData(skelAnimDataGameHeader_t *data)
{
skanChannelHdr *pChannel;
int i;
int channelType;
if (!data || data == (skelAnimDataGameHeader_t *)-476) {
if (!data) {
return;
}
for (i = 0; i < data->nTotalChannels; i++) {
pChannel = &data->ary_channels[i];
channelType = GetBoneChannelType(data->channelList.ChannelName(skeletor_c::ChannelNames(), i));
if (pChannel->ary_frames) {
if (channelType != 2) {
Skel_Free(pChannel->ary_frames);
}
}