diff --git a/src/microsim/devices/MSDevice_Battery.cpp b/src/microsim/devices/MSDevice_Battery.cpp index 960c8527ae66..7ac747bf5dbb 100644 --- a/src/microsim/devices/MSDevice_Battery.cpp +++ b/src/microsim/devices/MSDevice_Battery.cpp @@ -75,7 +75,9 @@ MSDevice_Battery::buildVehicleDevices(SUMOVehicle& v, std::vectorsetBattery(device); + if (sf != nullptr) { + sf->setBattery(device); + } /* if (sf != nullptr) { if (device->tracksFuel()) {