diff --git a/data/uking_functions.csv b/data/uking_functions.csv index ac76da19..39a1ba94 100644 --- a/data/uking_functions.csv +++ b/data/uking_functions.csv @@ -89481,11 +89481,11 @@ 0x00000071011baed4,ActorBase::setJobPriority2,288, 0x00000071011baff4,ActorBase::sleep,308, 0x00000071011bb128,ActorBase::wakeUp,484, -0x00000071011bb30c,ActorBase::getConnectedCalcChild,32, -0x00000071011bb32c,ActorBase::setConnectedCalcChild,248, +0x00000071011bb30c,ActorBase::getConnectedCalcChild,32,_ZNK4ksys3act8BaseProc21getConnectedCalcChildEv +0x00000071011bb32c,ActorBase::setConnectedCalcChild,248,_ZN4ksys3act8BaseProc21setConnectedCalcChildEPS1_b 0x00000071011bb424,ActorBase::setConnectedCalcParent,248,_ZN4ksys3act8BaseProc22setConnectedCalcParentEPS1_b -0x00000071011bb51c,ActorBase::resetConnectedCalcChild,188, -0x00000071011bb5d8,ActorBase::resetConnectedCalcParent,188, +0x00000071011bb51c,ActorBase::resetConnectedCalcChild,188,_ZN4ksys3act8BaseProc23resetConnectedCalcChildEb +0x00000071011bb5d8,ActorBase::resetConnectedCalcParent,188,_ZN4ksys3act8BaseProc24resetConnectedCalcParentEb 0x00000071011bb6a0,ActorBase::setCreatePriorityState2,12, 0x00000071011bb6ac,ActorBase::rtti1,112,_ZNK4ksys3act8BaseProc27checkDerivedRuntimeTypeInfoEPKN4sead15RuntimeTypeInfo9InterfaceE 0x00000071011bb71c,ActorBase::rtti2,92,_ZNK4ksys3act8BaseProc18getRuntimeTypeInfoEv diff --git a/src/KingSystem/ActorSystem/actBaseProc.cpp b/src/KingSystem/ActorSystem/actBaseProc.cpp index 79e2cc47..2748f667 100644 --- a/src/KingSystem/ActorSystem/actBaseProc.cpp +++ b/src/KingSystem/ActorSystem/actBaseProc.cpp @@ -449,4 +449,54 @@ bool BaseProc::setConnectedCalcParent(BaseProc* parent, bool delete_parent_on_de return true; } +void BaseProc::resetConnectedCalcParent(bool clear_existing_set_request) { + if (isDeletedOrDeleting()) + return; + + if (clear_existing_set_request) { + mStateFlags.reset(StateFlags::RequestSetParent); + mConnectedCalcParentNew = nullptr; + } + + if (mConnectedCalcParent) + BaseProcMgr::instance()->addToUpdateStateList(*this, StateFlags::RequestResetParent); +} + +BaseProc* BaseProc::getConnectedCalcChild() const { + if (!mConnectedCalcChild || mConnectedCalcChild->mState == State::Delete) + return nullptr; + + return mConnectedCalcChild; +} + +bool BaseProc::setConnectedCalcChild(BaseProc* child, bool delete_child_on_delete) { + if (child == nullptr) + return false; + + if (isDeletedOrDeleting() || child->isDeletedOrDeleting()) + return false; + + if (BaseProcMgr::instance()->addToUpdateStateList(*this, StateFlags::RequestSetChild)) + return false; + + mConnectedCalcChildNew = child; + + mFlags.change(Flags::DeleteChildOnDelete, delete_child_on_delete); + + return true; +} + +void BaseProc::resetConnectedCalcChild(bool clear_existing_set_request) { + if (isDeletedOrDeleting()) + return; + + if (clear_existing_set_request) { + mStateFlags.reset(StateFlags::RequestSetChild); + mConnectedCalcChildNew = nullptr; + } + + if (mConnectedCalcChild) + BaseProcMgr::instance()->addToUpdateStateList(*this, StateFlags::RequestResetChild); +} + } // namespace ksys::act diff --git a/src/KingSystem/ActorSystem/actBaseProc.h b/src/KingSystem/ActorSystem/actBaseProc.h index 41393c0b..4d2675f0 100644 --- a/src/KingSystem/ActorSystem/actBaseProc.h +++ b/src/KingSystem/ActorSystem/actBaseProc.h @@ -111,7 +111,7 @@ public: void resetConnectedCalcParent(bool clear_existing_set_request); BaseProc* getConnectedCalcChild() const; - void setConnectedCalcChild(BaseProc* child, bool delete_child_on_delete); + bool setConnectedCalcChild(BaseProc* child, bool delete_child_on_delete); void resetConnectedCalcChild(bool clear_existing_set_request); bool isSpecialJobType(JobType type);