Fixed crash when policy prerequisite is a branch (#8273)

Co-authored-by: tunerzinc@gmail.com <vfylfhby>
This commit is contained in:
vegeta1k95 2022-12-30 13:30:02 +01:00 committed by GitHub
parent 38d13570a7
commit 41b5cfa9b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -446,13 +446,17 @@ class PolicyPickerScreen(val worldScreen: WorldScreen, civInfo: CivilizationInfo
continue
val prereqButton = policyNameToButton[prereqName]
drawLine(group,
if (prereqButton != null) {
drawLine(
group,
// Top center
policyButton.x + policyButton.width / 2,
policyButton.y + policyButton.height,
// Bottom center
prereqButton!!.x + prereqButton.width/2,
prereqButton.y)
prereqButton.x + prereqButton.width / 2,
prereqButton.y
)
}
}
}