From 5ddebce84be0905b28ce5975762f8b144ea4cbcd Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 8 Apr 2024 20:09:26 +0200 Subject: w --- src/critter-script.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/critter-script.cpp b/src/critter-script.cpp index ede5c5d7..5b9efbfa 100644 --- a/src/critter-script.cpp +++ b/src/critter-script.cpp @@ -27,10 +27,25 @@ struct empty_critter_script final : critter_script }; empty_critter_script::empty_critter_script() : critter_script{nullptr} {} -void empty_critter_script::on_init(const std::shared_ptr& p) { touch_ptr(p); } -void empty_critter_script::on_update(const std::shared_ptr& p, size_t&, const Ns&) { touch_ptr(p); } -void empty_critter_script::on_destroy(const std::shared_ptr& p, script_destroy_reason) { touch_ptr(p); } -void empty_critter_script::delete_self() noexcept {} +void empty_critter_script::on_init(const std::shared_ptr& p) +{ + DBG_nospace << "> init critter:" << (void*)&*p << " id:" << p->id << (p->name ? " name:" : "") << p->name; + touch_ptr(p); +} +void empty_critter_script::on_update(const std::shared_ptr& p, size_t&, const Ns&) +{ + DBG_nospace << "> update critter:" << (void*)&*p << " id:" << p->id << (p->name ? " name:" : "") << p->name; + touch_ptr(p); +} +void empty_critter_script::on_destroy(const std::shared_ptr& p, script_destroy_reason r) +{ + DBG_nospace << "> destroy critter:" << (void*)&*p << " id:" << p->id << " reason:" << (int)r << (p->name ? " name:" : "") << p->name; + touch_ptr(p); +} +void empty_critter_script::delete_self() noexcept +{ + DBG_nospace << "> delete critter:"; +} empty_critter_script empty_script_ = {}; -- cgit v1.2.3