This commit is contained in:
ZakatTeamI2P 2026-05-03 15:36:34 +04:00
commit c4fdc3ecda
2 changed files with 9 additions and 5 deletions

View file

@ -331,6 +331,7 @@ struct evalArg{
}; };
static VALUE evalHelper(evalArg *arg){ static VALUE evalHelper(evalArg *arg){
// crashes with Game_Battler_1 for some reason
VALUE argv[] = { arg->string, Qnil, arg->filename }; VALUE argv[] = { arg->string, Qnil, arg->filename };
return rb_funcall2(Qnil, rb_intern("eval"), ARRAY_SIZE(argv), argv); return rb_funcall2(Qnil, rb_intern("eval"), ARRAY_SIZE(argv), argv);
} }
@ -381,7 +382,7 @@ static void runRMXPScripts(BacktraceData &btData){
* still go wrong */ * still go wrong */
try{ try{
scriptArray = kernelLoadDataInt(scriptPack.c_str(), false); scriptArray = kernelLoadDataInt(scriptPack.c_str(), false);
printf("[runRMXPScripts] %s", scriptPack.c_str()); printf("[runRMXPScripts] %s\n", scriptPack.c_str());
}catch (const Exception &e){ }catch (const Exception &e){
showMsg(std::string("Failed to read script data: ") + e.msg); showMsg(std::string("Failed to read script data: ") + e.msg);
return; return;
@ -410,7 +411,7 @@ static void runRMXPScripts(BacktraceData &btData){
VALUE scriptName = rb_ary_entry(script, 1); VALUE scriptName = rb_ary_entry(script, 1);
VALUE scriptString = rb_ary_entry(script, 2); VALUE scriptString = rb_ary_entry(script, 2);
printf("[runRMXPScripts] Script Name: %s", rb_str_to_str(scriptName)); //printf("[runRMXPScripts] Script Name: %s\n", RSTRING_PTR(scriptName));
int result = Z_OK; int result = Z_OK;
unsigned long bufferLen; unsigned long bufferLen;
@ -433,8 +434,8 @@ static void runRMXPScripts(BacktraceData &btData){
if (result != Z_OK){ if (result != Z_OK){
static char buffer[256]; static char buffer[256];
snprintf(buffer, sizeof(buffer), "Error decoding script %ld: '%s'", i, RSTRING_PTR(scriptName)); snprintf(buffer, sizeof(buffer), "Error decoding script %ld: '%s'\n", i, RSTRING_PTR(scriptName));
printf("[runRMXPScripts] Script Name: %s", buffer); //printf("[runRMXPScripts] Script Name: %s\n", buffer);
showMsg(buffer); showMsg(buffer);
break; break;
@ -468,6 +469,8 @@ static void runRMXPScripts(BacktraceData &btData){
fname = newStringUTF8(buf, len); fname = newStringUTF8(buf, len);
btData.scriptNames.insert(buf, scriptName); btData.scriptNames.insert(buf, scriptName);
printf("%s\n", scriptName);
int state; int state;
evalString(string, fname, &state); evalString(string, fname, &state);
if (state) if (state)

View file

@ -207,7 +207,8 @@ RB_METHOD(_marshalLoad){
VALUE marsh = rb_const_get(rb_cObject, rb_intern("Marshal")); VALUE marsh = rb_const_get(rb_cObject, rb_intern("Marshal"));
VALUE v[] = { port, utf8Proc }; VALUE v[] = { port, utf8Proc };
return rb_funcall_with_block(marsh, rb_intern("_mkxp_load_alias"), 1, &port, utf8Proc); return rb_marshal_load(port); // uh.. well.. it works now at least.
//return rb_funcall_with_block(marsh, rb_intern("_mkxp_load_alias"), 1, &port, utf8Proc);
} }
void fileIntBindingInit(){ void fileIntBindingInit(){