mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-09 22:55:35 +00:00
Fix for importing definitions with missing slots
This commit is contained in:
@@ -224,7 +224,9 @@ export function shipFromJson(json) {
|
|||||||
// Now that we know what we're looking for, find it
|
// Now that we know what we're looking for, find it
|
||||||
const hardpointName = HARDPOINT_NUM_TO_CLASS[hardpointClassNum] + 'Hardpoint' + hardpointSlotNum;
|
const hardpointName = HARDPOINT_NUM_TO_CLASS[hardpointClassNum] + 'Hardpoint' + hardpointSlotNum;
|
||||||
const hardpointSlot = json.modules[hardpointName];
|
const hardpointSlot = json.modules[hardpointName];
|
||||||
if (!hardpointSlot.module) {
|
if (!hardpointSlot) {
|
||||||
|
// This can happen with old imports that don't contain new hardpoints
|
||||||
|
} else if (!hardpointSlot.module) {
|
||||||
// No module
|
// No module
|
||||||
} else {
|
} else {
|
||||||
const hardpointJson = hardpointSlot.module;
|
const hardpointJson = hardpointSlot.module;
|
||||||
@@ -251,7 +253,9 @@ export function shipFromJson(json) {
|
|||||||
}
|
}
|
||||||
internalSlotNum++;
|
internalSlotNum++;
|
||||||
}
|
}
|
||||||
if (!internalSlot.module) {
|
if (!internalSlot) {
|
||||||
|
// This can happen with old imports that don't contain new slots
|
||||||
|
} else if (!internalSlot.module) {
|
||||||
// No module
|
// No module
|
||||||
} else {
|
} else {
|
||||||
const internalJson = internalSlot.module;
|
const internalJson = internalSlot.module;
|
||||||
|
|||||||
Reference in New Issue
Block a user