Page 1 of 1

[0.18.17] Crash when accessing LuaPlayer.entity_copy_source while player is dead

Posted: Wed Apr 01, 2020 10:10 pm
by Muppet9010
Please see JustARandomGeek's first post below for a more succinct reproduction process.


Old Title: [0.18.17] Crash using "--instrument-mod" "debugadapter" in specific use case

I'm logging this here first rather than with JustARandomGeek as its a hard game crash. However, I fully appreciate that the issue is surfacing from the vsCode extension and so it may not be an interest to other than him.

With a the attached muppet_streamer mod extract it to a folder in the Factorio mods folder.
Open the mod folder in VS Code with the debug adpater.
Add a breakpoint on scripts\leaky-flamethrower.lua line 85.
Run the game within the VSCode debugger.
Start a new game
Kill the player: /c game.player.character.die()
Click respawn and before the respawn timer completes do the next step.
Run the command to trigger the mod replacing "muppet9010" with your player name: /muppet_streamer_leaky_flamethrower {"delay":0, "ammoCount":5, "target":"muppet9010"}
The breakpoint will be hit in VS Code
In VScode hover over the variable "targetPlayer" on the line 85.
Give the game a second and the game will crash.

Re: [0.18.17] Crash using "--instrument-mod" "debugadapter" in specific use case

Posted: Wed Apr 01, 2020 10:53 pm
by justarandomgeek
After some digging, this same crash is also reproduced by `/c game.print(game.player.entity_copy_source.valid)` while the current player is dead, even without my debugger attached, so it looks like this is a base game bug that I simply revealed by attempting to access every possible property.

A more correct title is probably "Crash when accessing LuaPlayer.entity_copy_source while player is dead"

Re: [0.18.17] Crash when accessing LuaControl.entity_copy_source of player while dead

Posted: Wed Apr 01, 2020 11:00 pm
by Muppet9010
title updated, thanks for the help by looking at this. you obviously know far too much :P

Re: [0.18.17] Crash when accessing LuaPlayer.entity_copy_source while player is dead

Posted: Wed Apr 01, 2020 11:56 pm
by Rseding91
Thanks for the report. It's now fixed for the next release.