Resolve orbit body via getOrbitObject on client

This commit is contained in:
RallyBlock committed 2026-11-09 21:05:47 -05:00
1 parent b46e31f0d1
commit ac9815ed79
1 file changed
+27 -5
+27 -5
View File
@@ -593,11 +593,7 @@ function RPGClient_ApplyCamera(%forceSync)
} }
%now = getSimTime(); %now = getSimTime();
%doSync = %forceSync || %now - $RPGClient::LastCamSync >= 40; %doSync = %forceSync || %now - $RPGClient::LastCamSync >= 40;
%body = %conn.Player; %body = RPGClient_BodyForCamera(%conn);
if (!isObject(%body))
{
%body = %conn.player;
}
if (!isObject(%body)) if (!isObject(%body))
{ {
return; return;
@@ -715,6 +711,32 @@ function RPGClient_GetConn()
return 0; return 0;
} }
function RPGClient_BodyForCamera(%conn)
{
if (!isObject(%conn))
{
return 0;
}
%body = %conn.Player;
if (!isObject(%body))
{
%body = %conn.player;
}
if (!isObject(%body))
{
%co = %conn.getControlObject();
if (isObject(%co) && %co.getClassName() $= "Camera" && isObject(%co.getOrbitObject()))
{
%body = %co.getOrbitObject();
}
}
if (!isObject(%body) && isObject(%conn.Camera) && isObject(%conn.Camera.getOrbitObject()))
{
%body = %conn.Camera.getOrbitObject();
}
return %body;
}
function RPGClient_SendHello() function RPGClient_SendHello()
{ {
if ($RPGClient::Server) if ($RPGClient::Server)