mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-05-30 03:14:20 +00:00
feat: make gm registration simpler and safer (#1932)
* gm registration re-work * fix errors Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * remove duplicate message * Remove duplicate function * add null check --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -31,11 +31,11 @@ PhysicsComponent::PhysicsComponent(Entity* parent, const int32_t componentID) :
|
||||
|
||||
if (m_Parent->HasVar(u"CollisionGroupID")) m_CollisionGroup = m_Parent->GetVar<int32_t>(u"CollisionGroupID");
|
||||
|
||||
RegisterMsg(MessageType::Game::GET_POSITION, this, &PhysicsComponent::OnGetPosition);
|
||||
RegisterMsg(&PhysicsComponent::OnGetPosition);
|
||||
}
|
||||
|
||||
bool PhysicsComponent::OnGetPosition(GameMessages::GameMsg& msg) {
|
||||
static_cast<GameMessages::GetPosition&>(msg).pos = GetPosition();
|
||||
bool PhysicsComponent::OnGetPosition(GameMessages::GetPosition& msg) {
|
||||
msg.pos = GetPosition();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -245,8 +245,7 @@ void PhysicsComponent::SpawnVertices(dpEntity* entity) const {
|
||||
}
|
||||
}
|
||||
|
||||
bool PhysicsComponent::OnGetObjectReportInfo(GameMessages::GameMsg& msg) {
|
||||
auto& reportInfo = static_cast<GameMessages::GetObjectReportInfo&>(msg);
|
||||
bool PhysicsComponent::OnGetObjectReportInfo(GameMessages::GetObjectReportInfo& reportInfo) {
|
||||
auto& info = reportInfo.info->PushDebug("Physics");
|
||||
reportInfo.subCategory = &info;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user