From b93032e49cd69da178984f9912205d182f12f61e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 2 May 2024 18:32:22 +0200 Subject: now call script update --- src/object.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'src/object.cpp') diff --git a/src/object.cpp b/src/object.cpp index f4c803b7..1bc6e015 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -365,4 +365,39 @@ void object::init_script(const std::shared_ptr&) {} void object::destroy_script_pre(const std::shared_ptr&, script_destroy_reason) {} void object::destroy_script_post() {} +void object::check_script_update_1(script_lifecycle state) +{ + switch (state) + { + case script_lifecycle::no_init: + //return; // for tests? + case script_lifecycle::COUNT: + case script_lifecycle::destroying: + case script_lifecycle::initializing: + case script_lifecycle::torn_down: + break; + case script_lifecycle::created: + return; + } + fm_abort("bad script state %d in update() #1", (int)state); +} + +bool object::check_script_update_2(script_lifecycle state) +{ + switch (state) + { + case script_lifecycle::no_init: + // bad = false; break; // for tests? + case script_lifecycle::COUNT: + case script_lifecycle::destroying: + case script_lifecycle::initializing: + break; + case script_lifecycle::torn_down: + return true; + case script_lifecycle::created: + return false; + } + fm_abort("bad script state %d in update() #2", (int)state); +} + } // namespace floormat -- cgit v1.2.3