mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-05 18:24:12 +00:00
add child loading (#1706)
Tested that the NT combat challenge, am skullkin towers and qa wall in avant gardens all function as before.
This commit is contained in:
@@ -775,6 +775,12 @@ void Entity::Initialize() {
|
||||
// Hacky way to trigger these when the object has had a chance to get constructed
|
||||
AddCallbackTimer(0, [this]() {
|
||||
this->GetScript()->OnStartup(this);
|
||||
if (this->m_ParentEntity) {
|
||||
GameMessages::ChildLoaded childLoaded;
|
||||
childLoaded.childID = this->m_ObjectID;
|
||||
childLoaded.templateID = this->GetLOT();
|
||||
this->m_ParentEntity->OnChildLoaded(childLoaded);
|
||||
}
|
||||
});
|
||||
|
||||
if (!m_Character && Game::entityManager->GetGhostingEnabled()) {
|
||||
@@ -1501,6 +1507,10 @@ void Entity::OnShootingGalleryFire(GameMessages::ShootingGalleryFire& fire) {
|
||||
GetScript()->OnShootingGalleryFire(*this, fire);
|
||||
}
|
||||
|
||||
void Entity::OnChildLoaded(GameMessages::ChildLoaded& childLoaded) {
|
||||
GetScript()->OnChildLoaded(*this, childLoaded);
|
||||
}
|
||||
|
||||
void Entity::RequestActivityExit(Entity* sender, LWOOBJID player, bool canceled) {
|
||||
GetScript()->OnRequestActivityExit(sender, player, canceled);
|
||||
}
|
||||
|
@@ -16,6 +16,7 @@
|
||||
namespace GameMessages {
|
||||
struct ActivityNotify;
|
||||
struct ShootingGalleryFire;
|
||||
struct ChildLoaded;
|
||||
};
|
||||
|
||||
namespace Loot {
|
||||
@@ -217,6 +218,7 @@ public:
|
||||
void OnZonePropertyModelRotated(Entity* player);
|
||||
void OnActivityNotify(GameMessages::ActivityNotify& notify);
|
||||
void OnShootingGalleryFire(GameMessages::ShootingGalleryFire& notify);
|
||||
void OnChildLoaded(GameMessages::ChildLoaded& childLoaded);
|
||||
|
||||
void OnMessageBoxResponse(Entity* sender, int32_t button, const std::u16string& identifier, const std::u16string& userData);
|
||||
void OnChoiceBoxResponse(Entity* sender, int32_t button, const std::u16string& buttonIdentifier, const std::u16string& identifier);
|
||||
|
@@ -758,6 +758,13 @@ namespace GameMessages {
|
||||
NiPoint3 target{};
|
||||
NiQuaternion rotation{};
|
||||
};
|
||||
|
||||
struct ChildLoaded : public GameMsg {
|
||||
ChildLoaded() : GameMsg(MessageType::Game::CHILD_LOADED) {}
|
||||
|
||||
LOT templateID{};
|
||||
LWOOBJID childID{};
|
||||
};
|
||||
};
|
||||
|
||||
#endif // GAMEMESSAGES_H
|
||||
|
Reference in New Issue
Block a user