mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-11-16 07:08:48 +00:00
fix: ape anchor not respawning (#1927)
* fix: ape anchor not respawning * add return Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -189,6 +189,10 @@ Entity::~Entity() {
|
||||
}
|
||||
|
||||
if (m_ParentEntity) {
|
||||
GameMessages::ChildRemoved removedMsg{};
|
||||
removedMsg.childID = m_ObjectID;
|
||||
removedMsg.target = m_ParentEntity->GetObjectID();
|
||||
removedMsg.Send();
|
||||
m_ParentEntity->RemoveChild(this);
|
||||
}
|
||||
}
|
||||
@@ -198,6 +202,7 @@ void Entity::Initialize() {
|
||||
RegisterMsg<GameMessages::DropClientLoot>(this, &Entity::MsgDropClientLoot);
|
||||
RegisterMsg<GameMessages::GetFactionTokenType>(this, &Entity::MsgGetFactionTokenType);
|
||||
RegisterMsg<GameMessages::PickupItem>(this, &Entity::MsgPickupItem);
|
||||
RegisterMsg<GameMessages::ChildRemoved>(this, &Entity::MsgChildRemoved);
|
||||
/**
|
||||
* Setup trigger
|
||||
*/
|
||||
@@ -2352,3 +2357,8 @@ bool Entity::MsgPickupItem(GameMessages::GameMsg& msg) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Entity::MsgChildRemoved(GameMessages::GameMsg& msg) {
|
||||
GetScript()->OnChildRemoved(*this, static_cast<GameMessages::ChildRemoved&>(msg));
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user