Server-only cam; no pan; no client orbit fight
This commit is contained in:
1 parent
7e9d219678
commit
d8289b9507
1 file changed
+8
-44
@@ -166,10 +166,10 @@ function RPGClient_EyeRay(%nx, %ny)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
%p = %body.getPosition();
|
||||
%cx = getWord(%p, 0) + $RPGClient::PanX;
|
||||
%cy = getWord(%p, 1) + $RPGClient::PanY;
|
||||
%cz = getWord(%p, 2) + 1.5;
|
||||
%p = %body.getHackPosition();
|
||||
%cx = getWord(%p, 0);
|
||||
%cy = getWord(%p, 1);
|
||||
%cz = getWord(%p, 2) + 1.0;
|
||||
%yaw = $RPGClient::Yaw;
|
||||
%dist = $RPGClient::Dist;
|
||||
%pitch = $RPGClient::Pitch > 0 ? $RPGClient::Pitch : $RPGClient::TopDownPitch;
|
||||
@@ -260,7 +260,7 @@ function RPGClient_SendClick(%button, %pos, %guiNorm)
|
||||
%norm = %guiNorm ? RPGClient_NormPos(RPGClient_Mouse, %pos) : RPGClient_NormScreenPos(%pos);
|
||||
%nx = getWord(%norm, 0);
|
||||
%ny = getWord(%norm, 1);
|
||||
commandToServer('RPG_Click', %button, %nx, %ny, RPGClient_Aspect(), $RPGClient::Yaw, $RPGClient::Dist, $RPGClient::Pitch, $RPGClient::PanX, $RPGClient::PanY);
|
||||
commandToServer('RPG_Click', %button, %nx, %ny, RPGClient_Aspect(), $RPGClient::Yaw, $RPGClient::Dist, $RPGClient::Pitch, 0, 0);
|
||||
if (%button == 0)
|
||||
{
|
||||
%gnd = RPGClient_PickGround(%nx, %ny);
|
||||
@@ -706,45 +706,9 @@ function RPGClient_ApplyCamera(%forceSync)
|
||||
return;
|
||||
}
|
||||
$RPGClient::LastCamSync = %now;
|
||||
commandToServer('RPG_CamSync', $RPGClient::Yaw, $RPGClient::Dist, $RPGClient::PanX, $RPGClient::PanY, $RPGClient::Pitch);
|
||||
if (RPGClient_NetCam())
|
||||
{
|
||||
return;
|
||||
}
|
||||
%conn = RPGClient_GetConn();
|
||||
if (!isObject(%conn))
|
||||
{
|
||||
return;
|
||||
}
|
||||
%body = RPGClient_BodyForCamera(%conn);
|
||||
if (!isObject(%body))
|
||||
{
|
||||
return;
|
||||
}
|
||||
%cam = %conn.Camera;
|
||||
if (!isObject(%cam))
|
||||
{
|
||||
%cam = %conn.camera;
|
||||
}
|
||||
if (!isObject(%cam))
|
||||
{
|
||||
return;
|
||||
}
|
||||
%conn.setControlObject(%cam);
|
||||
$mvFreeLook = 0;
|
||||
$firstPerson = 0;
|
||||
%xfm = RPGClient_ViewTransform(%body, $RPGClient::Yaw, $RPGClient::Dist, $RPGClient::PanX, $RPGClient::PanY);
|
||||
%cam.unmountImage(0);
|
||||
if (!$RPGClient::OrbitInit)
|
||||
{
|
||||
%cam.setMode("Corpse", %body);
|
||||
%cam.mode = "Corpse";
|
||||
%cam.thirdPersonOnly = 1;
|
||||
$RPGClient::OrbitInit = 1;
|
||||
}
|
||||
%cam.setOrbitMode(%body, %xfm, 0, 32, $RPGClient::Dist);
|
||||
%cam.setTransform(%xfm);
|
||||
%cam.setOrbitDist($RPGClient::Dist);
|
||||
$RPGClient::PanX = 0;
|
||||
$RPGClient::PanY = 0;
|
||||
commandToServer('RPG_CamSync', $RPGClient::Yaw, $RPGClient::Dist, 0, 0, $RPGClient::Pitch);
|
||||
}
|
||||
|
||||
function RPGClient_ScheduleCamera()
|
||||
|
||||
Reference in new issue
Block a user