STARK: Fix crash when showing exits for items with no animation set

Fixes #1531.
This commit is contained in:
Bastien Bouclet 2019-04-08 21:07:01 +02:00
parent 10c4458976
commit b91c4cdf71

View File

@ -409,12 +409,15 @@ Common::Array<Common::Point> ItemVisual::listExitPositionsImpl() {
Common::Point invalidPosition(-1, -1);
for (uint i = 0; i < pattables.size(); ++i) {
if (pattables[i]->getDefaultAction() == PATTable::kActionExit) {
Common::Point hotspot = getAnim()->getHotspotPosition(i);
if (hotspot != invalidPosition) {
hotspot += _renderEntry->getPosition();
positions.push_back(hotspot);
}
if (pattables[i]->getDefaultAction() != PATTable::kActionExit) continue;
Anim *anim = getAnim();
if (!anim) continue;
Common::Point hotspot = anim->getHotspotPosition(i);
if (hotspot != invalidPosition) {
hotspot += _renderEntry->getPosition();
positions.push_back(hotspot);
}
}