#include #include #include namespace Utils { std::optional GetServerId(entt::entity aEntity) noexcept { const auto* pLocalComponent = World::Get().try_get(aEntity); const auto* pRemoteComponent = World::Get().try_get(aEntity); const auto* pObjectComponent = World::Get().try_get(aEntity); uint32_t serverId = -1; if (pLocalComponent) serverId = pLocalComponent->Id; else if (pRemoteComponent) serverId = pRemoteComponent->Id; else if (pObjectComponent) serverId = pObjectComponent->Id; else { const auto* pFormIdComponent = World::Get().try_get(aEntity); spdlog::debug("{}: This entity has neither a local or remote component: {:X}, form id: {:X}", __FUNCTION__, to_integral(aEntity), pFormIdComponent ? pFormIdComponent->Id : 0); return std::nullopt; } return {serverId}; } void ShowHudMessage(const TiltedPhoques::String& acMessage) { using TShowHudMessage = void(const char*, const char*, bool); POINTER_SKYRIMSE(TShowHudMessage, s_showHudMessage, 52933); s_showHudMessage(acMessage.c_str(), nullptr, false); } } // namespace Utils