Fixes crash when opening HirelingPanel before items have finished loading

This commit is contained in:
Collin Smith 2020-01-18 02:52:39 -08:00
parent d8ff97e4a5
commit a8999db873

View File

@ -367,7 +367,7 @@ public class HirelingPanel extends WidgetGroup implements Disposable {
}
// FIXME: Alt images on weapons are slightly off by maybe a pixel or so (rounding?) -- backgrounds fine
if (item != null) {
if (item != null && item.checkLoaded()) {
BBox box = item.invFile.getBox();
item.setPosition(
getX() + getWidth() / 2 - box.width / 2f + x,