diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-04-08 20:09:26 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-04-08 20:09:26 +0200 |
commit | 5ddebce84be0905b28ce5975762f8b144ea4cbcd (patch) | |
tree | 783573de960b93fee7e2dc1502cbb43f8fa8b2ea /src | |
parent | ce1893bbc74c76c1b130c4ac3391605a6104ff50 (diff) |
w
Diffstat (limited to 'src')
-rw-r--r-- | src/critter-script.cpp | 23 |
1 files 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<critter>& p) { touch_ptr(p); } -void empty_critter_script::on_update(const std::shared_ptr<critter>& p, size_t&, const Ns&) { touch_ptr(p); } -void empty_critter_script::on_destroy(const std::shared_ptr<critter>& p, script_destroy_reason) { touch_ptr(p); } -void empty_critter_script::delete_self() noexcept {} +void empty_critter_script::on_init(const std::shared_ptr<critter>& 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<critter>& 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<critter>& 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_ = {}; |