diff --git a/source/games/exhumed/src/player.cpp b/source/games/exhumed/src/player.cpp index bd6f10683..e0671b1c3 100644 --- a/source/games/exhumed/src/player.cpp +++ b/source/games/exhumed/src/player.cpp @@ -1928,7 +1928,6 @@ static void doPlayerActionSequence(DExhumedPlayer* const pPlayer) const auto pPlayerActor = pPlayer->GetActor(); const auto playerSeq = getSequence(pPlayerActor->nSeqFile, PlayerSeq[pPlayerActor->nAction].nSeqId); - if (playerSeq == nullptr) return; const auto seqSize = playerSeq->frames.Size(); if (pPlayerActor->nFrame >= seqSize) pPlayerActor->nFrame = seqSize - 1; const auto& seqFrame = playerSeq->frames[pPlayerActor->nFrame]; diff --git a/source/games/exhumed/src/sequence.h b/source/games/exhumed/src/sequence.h index 46530e422..450ad45d2 100644 --- a/source/games/exhumed/src/sequence.h +++ b/source/games/exhumed/src/sequence.h @@ -88,9 +88,9 @@ TArray* getFileSeqs(const FName nSeqFile); inline Seq* getSequence(const FName nSeqFile, const unsigned nSeqIndex = 0) { - auto seq = getFileSeqs(nSeqFile); - if (nSeqIndex >= seq->Size()) return nullptr; - return seq->Data(nSeqIndex); + const auto seq = getFileSeqs(nSeqFile); + const auto seqSize = seq->Size(); + return seq->Data((nSeqIndex >= seqSize) ? seqSize - 1 : nSeqIndex); } END_PS_NS