Closed mashirochan closed 12 months ago
Try stepping through the code and see where exactly you crash. Could be anything right now - a null pointer dereference, some invalid memory being accessed...
Is this an actual YYTK bug that needs reporting? Or will this only ever happen because of user error? Because if it's the latter, I've figured out how to do what I wanted, and the game no longer crashes. If this is an actual bug, then I can swap my code back and do some testing for you.
else if (_strcmpi(Code->i_pName, "gml_Object_obj_Sticker_Collision_obj_Player") == 0) {
auto Sticker_Collision_obj_Player = [](YYTKCodeEvent* pCodeEvent, CInstance* Self, CInstance* Other, CCode* Code, RValue* Res, int Flags) {
pCodeEvent->Call(Self, Other, Code, Res, Flags);
YYRValue yyrv_collectedSticker;
CallBuiltin(yyrv_collectedSticker, "variable_global_get", Self, Other, { "collectedSticker" });
YYRValue yyrv_optionName;
CallBuiltin(yyrv_optionName, "struct_get", Self, Other, { yyrv_collectedSticker, "optionName" });
PrintMessage(CLR_BRIGHTPURPLE, "Sticker Name: %s", static_cast<const char*>(yyrv_optionName));
};
Sticker_Collision_obj_Player(pCodeEvent, Self, Other, Code, Res, Flags);
codeFuncTable[Code->i_CodeIndex] = Sticker_Collision_obj_Player;
}
Might have been user error, might have been struct misalignment. The lookup of variables via the hash map is not well tested, so it's recommended to just use GM builtins to do it.
I'd assuming it's just user error, because now I'm getting the same error message with just this small bit of simple code - I'm extremely C-lang illiterate, so I will just close this issue and chalk it up to my lack of knowledge in pointers, references, and callbacks.
for (int i = 0; i < yyrv_currentStickers.RefArray->length; i++) {
CallBuiltin(yyrv_arrayValue, "array_get", Self, Other, { yyrv_currentStickers, (long long) i });
}
A fatal error has occured inside YYToolkit. Please report this occurence to the GitHub issue tracker.
Message: Exception 0xC0000005 occured at 00007FF943FE39D1
Version: YYToolkit 2.1.3b Early Injection: Disabled File: Src\MainEntry.cpp Line: 24 Debugger Present: No
Code that triggered crash:
After changing code, this still causes the same crash:
Game: HoloCure
Issue occurs when closing the sticker menu after picking up a sticker.