Open AGraber opened 6 years ago
No, that is a bug - inlines should be usable from OnScriptInit
. The only rule is that they can't be used from OnCodeInit
. That is the special callback reserved for generating code, thus anything that requires generated code can't be used in there.
Ok, try this, as I was reminded in your other issue:
https://github.com/pawn-lang/YSI-Includes/blob/5.x/YSI_Coding/y_malloc/faqs.md
This is still an issue. Using y_inline
inside OnScriptInit
will give run time error but it works alright in OnGameModeInit
callback.
I use the latest version of YSI 5
and amx_assembly
and the functions from y_inline_extra.inc
Run time error 5: "Invalid memory access"
AMX backtrace:
#0 00009808 in public Indirect_FromCallback () at <...>\YSI_Coding\y_inline\..\y_va\..\..\YSI_Core\y_core\..\..\amx\asm.inc:235
I also tried YSI_NO_HEAP_MALLOC
and gives different run time error.
Run time error 6: "Invalid instruction"
Unknown opcode 0xfffffff8 at address 0x00004F54
AMX backtrace:
#0 00004f54 in public Indirect_FromCallback (F@_@:cb=20308, bool:release=true) at <...>\YSI_Coding\y_malloc\..\..\YSI_Core\y_core\..\..\amx\amx_header.inc:582
Run time error 6: "Invalid instruction"
Unknown opcode 0x3d446d8 at address 0x00004ED4
AMX backtrace:
#0 00004ed4 in public Indirect_FromCallback (F@_@:cb=20180, bool:release=true) at <...>\YSI_Coding\y_malloc\..\..\YSI_Core\y_core\..\..\amx\amx_header.inc:579
However, it doesn't crash when using OnGameModeInit. Is this expected? I don't know if I should be using OnScriptInit after all.