Fix debugger not detaching when CPU entity is removed#73
Fix debugger not detaching when CPU entity is removed#73DerelictDrone merged 5 commits intowiremod:masterfrom
Conversation
DerelictDrone
left a comment
There was a problem hiding this comment.
Works well, but in my testing detaching manually (by pressing R with the cpu tool) reports the detach message twice.
(first detached with no attached debugger, second attached, then detaching will produce two messages)
This is due to a second net send for invalidating the debugger within the stool's own file, present here:
wire-cpu/lua/wire/stools/cpu.lua
Lines 48 to 68 in 1113394
Once resolved, this should be ready for merge tomorrow.
|
I believe I've fixed it! |
There was a problem hiding this comment.
Need to clear this flag and on remove hook during detach if possible, as deleting the CPU after detaching your debugger reports that it was detached(again), after that we should be good assuming nothing else crops up
https://github.com/wiremod/wire-cpu/pull/73/files#diff-7ef44bc4870f2b9b65b05f458388a300de8f00377bfa7430d5e5b7e5026ce3b7R617-R623
|
Working on it |
|
I hope everthing is correct now. |
DerelictDrone
left a comment
There was a problem hiding this comment.
Tested and working as intended.
When a debugger is attached to a CPU entity, removing the entity does not currently detach the debugger. As a result, the debugger remains attached to a non-existent CPU, which can be confusing.
This PR ensures the debugger is properly detached when the CPU entity is removed, also creates a DetachDebugger method that removes the giant chunk of code in the original AttachDebugger method that was responsible for detaching it manually.