Application: fix crash when weapon has no parts.
This commit is contained in:
parent
1dd2be6768
commit
a35cddfc0c
1 changed files with 5 additions and 0 deletions
|
@ -424,6 +424,11 @@ Application::drawWeaponEditor(GameObjects::Weapon& weapon) {
|
||||||
|
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
|
|
||||||
|
if(weapon.parts.isEmpty()) {
|
||||||
|
ImGui::TextUnformatted("This weapon has no parts.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(ImGui::CollapsingHeader("Weapon parts")) {
|
if(ImGui::CollapsingHeader("Weapon parts")) {
|
||||||
drawAlignedText("Viewing/editing part:");
|
drawAlignedText("Viewing/editing part:");
|
||||||
for(std::int32_t i = 0; std::size_t(i) < weapon.parts.size(); i++) {
|
for(std::int32_t i = 0; std::size_t(i) < weapon.parts.size(); i++) {
|
||||||
|
|
Loading…
Reference in a new issue