RivalAUT / FS19_Script_collection

11 stars 5 forks source link

Solved problem while detaching #7

Closed jason0611 closed 3 years ago

jason0611 commented 3 years ago

While detaching cutters, cameras were not disconnected from the vehicle as they should.

RivalAUT commented 3 years ago

Was there a problem before that is now gone? The function removeAdditionalCam takes only the camId as argument, therefore the unpack should not be needed.

jason0611 commented 3 years ago

Yesterday I prepared a second cutter with AdditionalCutterCam and noticed, that the cams of the first cutter keep connected with the harvester, preventing the second one to come active. I took a look into the Lua code and found out, that cam was a table with two elements, but the first element could not be referenced as cam.id, but as cam[1]. To keep it similar to the corresponding addAdditionalCam I replaced cam[1] with unpack(cam), because Lua will discard the resulting second element if not needed. With this modification all cams work as expected. Tested with Windows and macOS. Should we communicate further on in English or switch to German? I'm a German native speaker... ;-)

RivalAUT commented 3 years ago

Ok. Dann übernehme ich das :)