Open MineCake147E opened 5 months ago
Can indeed reproduce.
Strangely only crashes on Windows, works fine on Linux.
i think this is another use after free...?
Yes, obviously.
seems like the Robot Manager never receives ENTITY_EVENT_REMOVE
, even though it's subscribed to it
literally have no idea why this doesn't work, since Lua Script relies on the same event and it does work there... (even if it's actually not handled properly)
seems like subscriptions get reset??? between initialization and actual absorb.
calling subscribe every frame (hack) fixes the issue....??
... interesting...
seems like this is a side effect of the default setup
implementation, which clears all listeners and subscriptions
(The robot manager subscribes to the ENTITY_EVENT_REMOVE
event in the init
"stage", which gets called before setup
)
Commenting out the following lines in the setup
implementation "fixes" the issue:
// this->listeners.clear();
// this->subscriptions.clear();
But I'm pretty sure this has some unintended side effects...
By the way, saving and reloading the state before the robot is absorbed causes the game to not crash, since setup
is not called if the level is reloaded from a state buffer:
Principia version
1.5.2 Beta build 2023-12-26
OS / Hardware
Summary
Here is a table of Inputs that crash the game when the controlled robot gets absorbed.
❌: The game doesn't crash ✅: The game crashes
* For IN18, the robot under control doesn't fall. There are some additional set of conditions to crash the game. To crash the game, one of these conditions below must be satisfied.
Steps to reproduce
Empty Adventure
level.1.0
.