diff options
Diffstat (limited to 'src/script/cpp_api')
-rw-r--r-- | src/script/cpp_api/s_client.cpp | 5 | ||||
-rw-r--r-- | src/script/cpp_api/s_client.h | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/script/cpp_api/s_client.cpp b/src/script/cpp_api/s_client.cpp index b0e7a073e..1ed273a30 100644 --- a/src/script/cpp_api/s_client.cpp +++ b/src/script/cpp_api/s_client.cpp @@ -323,7 +323,7 @@ void ScriptApiClient::on_object_hp_change(s16 id) runCallbacks(1, RUN_CALLBACKS_MODE_FIRST); } -void ScriptApiClient::on_object_add(s16 id) +bool ScriptApiClient::on_object_add(s16 id) { SCRIPTAPI_PRECHECKHEADER @@ -335,7 +335,8 @@ void ScriptApiClient::on_object_add(s16 id) push_objectRef(L, id); // Call functions - runCallbacks(1, RUN_CALLBACKS_MODE_FIRST); + runCallbacks(1, RUN_CALLBACKS_MODE_OR); + return readParam<bool>(L, -1); } bool ScriptApiClient::on_inventory_open(Inventory *inventory) diff --git a/src/script/cpp_api/s_client.h b/src/script/cpp_api/s_client.h index 2f9ce7aa3..6d1a05943 100644 --- a/src/script/cpp_api/s_client.h +++ b/src/script/cpp_api/s_client.h @@ -65,7 +65,7 @@ public: bool on_spawn_particle(struct ParticleParameters param); void on_object_properties_change(s16 id); void on_object_hp_change(s16 id); - void on_object_add(s16 id); + bool on_object_add(s16 id); bool on_inventory_open(Inventory *inventory); void open_enderchest(); |