From ac0e622fce3f290c749989b39a5caf2494d99d8a Mon Sep 17 00:00:00 2001 From: twoone3l <3197653242@qq.com> Date: Fri, 14 Jan 2022 19:49:12 +0800 Subject: [PATCH] =?UTF-8?q?1.9.0=E6=9B=B4=E6=96=B0=EF=BC=8C=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E5=9B=9E=E4=BC=A0=E6=96=B0=E5=A2=9Eplayer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mod/Entity.cpp | 12 ++++++------ mod/Version.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mod/Entity.cpp b/mod/Entity.cpp index bd6544ad..316a9160 100644 --- a/mod/Entity.cpp +++ b/mod/Entity.cpp @@ -381,9 +381,9 @@ struct PyEntity { if (!PyFunction_Check(callback)) return nullptr; p->sendCustomFormPacket(str, - [callback](string arg) { + [p, callback](string arg) { PyGILGuard gil; - PyObject* result = PyObject_CallFunction(callback, "s", arg.c_str()); + PyObject* result = PyObject_CallFunction(callback, "Os", ToEntity(p), arg.c_str()); PrintPythonError(); Py_XDECREF(result); } @@ -405,9 +405,9 @@ struct PyEntity { if (buttons.size() != images.size()) Py_RETURN_ERROR("The number of buttons is not equal to the number of images"); p->sendSimpleFormPacket(title, content, buttons, images, - [callback](int arg) { + [p, callback](int arg) { PyGILGuard gil; - PyObject* result = PyObject_CallFunction(callback, "i", arg); + PyObject* result = PyObject_CallFunction(callback, "Oi", ToEntity(p), arg); PrintPythonError(); Py_XDECREF(result); } @@ -425,9 +425,9 @@ struct PyEntity { if (!PyFunction_Check(callback)) return nullptr; p->sendModalFormPacket(title, content, button1, button2, - [callback](bool arg) { + [p, callback](bool arg) { PyGILGuard gil; - PyObject* result = PyObject_CallFunction(callback, "O", arg ? Py_True : Py_False); + PyObject* result = PyObject_CallFunction(callback, "OO", ToEntity(p), arg ? Py_True : Py_False); PrintPythonError(); Py_XDECREF(result); } diff --git a/mod/Version.h b/mod/Version.h index 6999b166..89409f24 100644 --- a/mod/Version.h +++ b/mod/Version.h @@ -2,4 +2,4 @@ constexpr unsigned PYR_MAJOR_VERSION = 1; constexpr unsigned PYR_MINOR_VERSION = 9; constexpr unsigned PYR_MICRO_VERSION = 0; -constexpr const char* PYR_VERSION = "v1.9.0_preview_3"; \ No newline at end of file +constexpr const char* PYR_VERSION = "v1.9.0"; \ No newline at end of file