MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / SyncNetState

Method SyncNetState

ogsr_engine/xrGame/Car.cpp:2010–2044  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2008}
2009
2010void CCar::SyncNetState()
2011{
2012 auto obj = PPhysicsShellHolder();
2013 if (!obj)
2014 return;
2015 auto se_obj = obj->alife_object();
2016 if (!se_obj)
2017 return;
2018
2019 auto co = smart_cast<CSE_ALifeCar*>(se_obj);
2020 ASSERT_FMT(co, "[%s]: %s is not CSE_ALifeCar", __FUNCTION__, obj->Name_script());
2021
2022 co->o_Position = Position();
2023 Fvector Angle;
2024 XFORM().getXYZ(Angle);
2025 co->o_Angle = Angle;
2026
2027 co->door_states.clear();
2028 for (auto& it : m_doors)
2029 {
2030 CSE_ALifeCar::SDoorState ds;
2031 it.second.SaveNetState(ds);
2032 co->door_states.push_back(ds);
2033 }
2034
2035 co->wheel_states.clear();
2036 for (auto& it : m_wheels_map)
2037 {
2038 CSE_ALifeCar::SWheelState ws;
2039 it.second.SaveNetState(ws);
2040 co->wheel_states.push_back(ws);
2041 }
2042
2043 co->health = GetfHealth();
2044}

Callers 2

net_DestroyMethod · 0.45
net_DestroyMethod · 0.45

Calls 8

XFORMFunction · 0.85
GetfHealthFunction · 0.85
getXYZMethod · 0.80
PPhysicsShellHolderFunction · 0.70
alife_objectMethod · 0.45
clearMethod · 0.45
SaveNetStateMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected