mirror of https://github.com/OpenTTD/OpenTTD
Fix 6317967: Missing exception for SetPipRatio(). (#11465)
parent
60651227a0
commit
f93711838f
|
@ -3254,6 +3254,8 @@ static const NWidgetPart *MakeNWidget(const NWidgetPart *nwid_begin, const NWidg
|
||||||
|
|
||||||
NWidgetBackground *nwb = dynamic_cast<NWidgetBackground *>(*dest);
|
NWidgetBackground *nwb = dynamic_cast<NWidgetBackground *>(*dest);
|
||||||
if (nwb != nullptr) nwb->SetPIPRatio(nwid_begin->u.pip.pre, nwid_begin->u.pip.inter, nwid_begin->u.pip.post);
|
if (nwb != nullptr) nwb->SetPIPRatio(nwid_begin->u.pip.pre, nwid_begin->u.pip.inter, nwid_begin->u.pip.post);
|
||||||
|
|
||||||
|
if (unlikely(nwc == nullptr && nwb == nullptr)) throw std::runtime_error("WPT_PIPRATIO requires NWidgetPIPContainer or NWidgetBackground");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue