During my use of this mod, I encountered several crashes of kill_count_statistics due to the destruction of drone entities. After multiple occurrences, I attempted a simple fix.
Upon studying the Lua code for drones, I identified an issue in line 743 of transport_drone.lua based on the provided clash information. This drone mod was hastily adapted for Factorio 2.0, and as a result, the author neglected to update the kill_count_statistics code. In version 2.0, significant changes were made to the planet system (specifically Class LuaSurface), altering how kill_count_statistics is accessed; it can no longer be directly accessed via entity.kill_count_statistics but must instead use get_kill_count_statistics(Surface surface). The retained direct access from ported 1.1 code led to crashes.
Ultimately, I modified the code to utilize get_kill_count_statistics and passed entity.surface as an argument.
This is my first experience with Lua and fixing game code; any guidance would be appreciated...
I dont konw how to upload my code to github item,Here are the fixed mod :
https://drive.google.com/file/d/13i-LySxQOD8mzL_-8w-qQJnKP1MinVf2/view?usp=sharing