Xentro / FS-Towbar

Specialization script for Farming Simulator
1 stars 1 forks source link

Hanging game with a lot errors in log #2

Open Maqentaer opened 2 months ago

Maqentaer commented 2 months ago

Hello! Thanks for the mod!

I got game hanging in some situations with Tow Bar 1.0.0.1:

  1. There was two tow bars near to each other and attached to different vehicles.
  2. One tow bar attached to tractor and other side near the dolly from mod "Gooseneck Dolly" 1.0.0.0.

There is a lot of same errors. Errors from log:

2024-06-18 03:09 Error: Running LUA method 'update'. D:/My Documents/My Games/FarmingSimulator2022/mods/FS22_TowBar/scripts/Towbar.lua:223: attempt to index field 'spec_attacherJoints' (a nil value)
...
2024-06-18 03:09 Error: Running LUA method 'update'.
D:/My Documents/My Games/FarmingSimulator2022/mods/FS22_TowBar/scripts/Towbar.lua:223: attempt to index field 'spec_attacherJoints' (a nil value)
2024-06-18 03:09 Error: Running LUA method 'update'.
D:/My Documents/My Games/FarmingSimulator2022/mods/FS22_TowBar/scripts/Towbar.lua:223: attempt to index field 'spec_attacherJoints' (a nil value)
2024-06-18 03:09 Error: Running LUA method 'update'.
D:/My Documents/My Games/FarmingSimulator2022/mods/FS22_TowBar/scripts/Towbar.lua:223: attempt to index field 'spec_attacherJoints' (a nil value)

...

2024-06-18 03:10 Error: Running LUA method 'update'. D:/My Documents/My Games/FarmingSimulator2022/mods/FS22_TowBar/scripts/Towbar.lua:148: attempt to index field 'spec_enterable' (a nil value)
...
2024-06-18 03:10 Error: Running LUA method 'update'.
D:/My Documents/My Games/FarmingSimulator2022/mods/FS22_TowBar/scripts/Towbar.lua:148: attempt to index field 'spec_enterable' (a nil value)
2024-06-18 03:10 Error: Running LUA method 'update'.
D:/My Documents/My Games/FarmingSimulator2022/mods/FS22_TowBar/scripts/Towbar.lua:148: attempt to index field 'spec_enterable' (a nil value)
2024-06-18 03:10 Error: Running LUA method 'update'.
D:/My Documents/My Games/FarmingSimulator2022/mods/FS22_TowBar/scripts/Towbar.lua:148: attempt to index field 'spec_enterable' (a nil value)
2024-06-18 03:10 Error: Running LUA method 'update'.
...

And I found 1 warning:

2024-06-18 03:10 Warning (script): 'removeJoint': Argument 1 has wrong type. Expected: Int. Actual: Nil =D:/My Documents/My Games/FarmingSimulator2022/mods/FS22_TowBar/scripts/Towbar.lua (277) : removeJoint
2024-06-18 03:10 Warning (script): 'removeJoint': Argument 1 has wrong type. Expected: Int. Actual: Nil 
2024-06-18 03:10   2024-06-18 03:10 D:\auto_builder\cache\svn\ebac29df05e8259ab65b77112f6766d3\src\base\scripting\lua\LuaScriptSystem.cpp (903)2024-06-18 03:10 : 2024-06-18 03:10 expectedType == Value::VoidType || expectedType == Value::ClassType
2024-06-18 03:10 LUA call stack:
  =D:/My Documents/My Games/FarmingSimulator2022/mods/FS22_TowBar/scripts/Towbar.lua (277) : removeJoint
  =D:/My Documents/My Games/FarmingSimulator2022/mods/FS22_TowBar/scripts/Towbar.lua (367) : setTowbarVehicle
  dataS/scripts/input/InputEvent.lua (100) : callback
  dataS/scripts/input/InputBinding.lua (3342) : notifyInput
  dataS/scripts/input/InputBinding.lua (3055) : updateInput
  dataS/scripts/main.lua (1257) : update
Maqentaer commented 2 months ago

made fix in #3