segabl / pd2-useful-bots

A lightweight bot overhaul
GNU General Public License v3.0
7 stars 5 forks source link

teamailogictravel.lua crash on Firestarter Day 3 #25

Closed Xiniox closed 1 year ago

Xiniox commented 1 year ago

While hosting, if a client tries to place the thermal drill before shutting off the power so they get electrocuted, the game will crash.

Happened while playing with a friend. I tried recreating it while playing solo, didn't crash. I then asked my friend to come along and try getting electrocuted again. Crashed. I removed Useful Bots and had my friend get electrocuted again, no crash.

Application has crashed: C++ exception
[string "lib/units/player_team/logics/teamailogictrave..."]:174: attempt to index field 'objective' (a nil value)

SCRIPT STACK

update() lib/units/enemies/cop/copbrain.lua:239
clbk() @mods/Full Speed Swarm/lua/teamaibrain.lua:35
_execute_queued_task() lib/managers/enemymanager.lua:600
_update_queued_tasks() @mods/Full Speed Swarm/lua/enemymanager.lua:43
update() @mods/Full Speed Swarm/lua/enemymanager.lua:31
original() lib/setups/gamesetup.lua:809
update() @mods/base/req/core/Hooks.lua:264
update() lib/setups/networkgamesetup.lua:21
core/lib/setups/coresetup.lua:559

-------------------------------

Callstack:

         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
                      KERNEL32  (???)     BaseThreadInitThunk                                 
                         ntdll  (???)     RtlGetAppContainerNamedObjectPath                   
                         ntdll  (???)     RtlGetAppContainerNamedObjectPath                   

-------------------------------

Current thread: Main

-------------------------------

System information:
    Application version : 1.139.195
    CPU : AMD Ryzen 5 5600X 6-Core Processor (6 cores); SSE; SSE2; SSE3; SSSE3; SSE4.1
    DirectX : 12.0 
    GPU : NVIDIA GeForce RTX 3070 / nvldumd.dll[31.0.15.3129]
    Language : english
    Memory :     32682MB 64KB
    OS : 6.2.9200 () 0x300-0x1 (64 bits)
    Physics : threaded
    Renderer : DX9 threaded
    Sound : Realtek Semiconductor Corp. (Speakers (Realtek(R) Audio))
segabl commented 1 year ago

I see, I do remember putting in checks for the host but I might have missed clients since that uses a different objective function for bots. Will have a look. Does it crash immediately when they get electrocuted?

Xiniox commented 1 year ago

It takes around 2-3 seconds of them being electrocuted before it crashes

segabl commented 1 year ago

Should be hopefully fixed in 14821c20708e17323acec4b27a63dee6492614ae, didn't have time to test it though

Xiniox commented 1 year ago

Tried it again with my friend, no crash. Seems to have fixed it! Tyvm :)