LagCompensation: fix PVS issues?
This commit is contained in:
parent
84465de343
commit
4c52227886
@ -39,6 +39,12 @@
|
||||
"library" "server"
|
||||
"linux" "@_ZN18CCollisionProperty24MarkPartitionHandleDirtyEv"
|
||||
}
|
||||
|
||||
"RecomputePVSInformation"
|
||||
{
|
||||
"library" "server"
|
||||
"linux" "@_ZN22CServerNetworkProperty23RecomputePVSInformationEv"
|
||||
}
|
||||
}
|
||||
|
||||
"Functions"
|
||||
|
@ -16,7 +16,7 @@ public Plugin myinfo =
|
||||
name = "LagCompensation",
|
||||
author = "BotoX",
|
||||
description = "",
|
||||
version = "1.0",
|
||||
version = "1.1",
|
||||
url = ""
|
||||
};
|
||||
|
||||
@ -112,6 +112,7 @@ bool g_bCleaningUp = true;
|
||||
|
||||
Handle g_hCalcAbsolutePosition;
|
||||
Handle g_hMarkPartitionHandleDirty;
|
||||
Handle g_hRecomputePVSInformation;
|
||||
|
||||
Handle g_hUTIL_Remove;
|
||||
Handle g_hRestartRound;
|
||||
@ -167,6 +168,15 @@ public void OnPluginStart()
|
||||
}
|
||||
g_hMarkPartitionHandleDirty = EndPrepSDKCall();
|
||||
|
||||
// CServerNetworkProperty::RecomputePVSInformation
|
||||
StartPrepSDKCall(SDKCall_Raw);
|
||||
if(!PrepSDKCall_SetFromConf(hGameData, SDKConf_Signature, "RecomputePVSInformation"))
|
||||
{
|
||||
delete hGameData;
|
||||
SetFailState("PrepSDKCall_SetFromConf(hGameData, SDKConf_Signature, \"RecomputePVSInformation\") failed!");
|
||||
}
|
||||
g_hRecomputePVSInformation = EndPrepSDKCall();
|
||||
|
||||
|
||||
// ::UTIL_Remove
|
||||
g_hUTIL_Remove = DHookCreateFromConf(hGameData, "UTIL_Remove");
|
||||
@ -892,6 +902,14 @@ void RecordDataIntoRecord(int iEntity, LagRecord Record)
|
||||
GetEntDataArray(iEntity, g_iCoordinateFrame, view_as<int>(Record.rgflCoordinateFrame), COORDINATE_FRAME_SIZE);
|
||||
Record.flSimulationTime = GetEntDataFloat(iEntity, g_iSimulationTime);
|
||||
|
||||
// Make sure to have fresh PVS info before caching it.
|
||||
// NetworkProp()->RecomputePVSInformation();
|
||||
Address NetworkProp = GetEntityAddress(iEntity) + view_as<Address>(g_iNetwork);
|
||||
SDKCall(g_hRecomputePVSInformation, NetworkProp);
|
||||
|
||||
if(GetEdictFlags(iEntity) & FL_EDICT_DIRTY_PVS_INFORMATION)
|
||||
PrintToBoth("POST FL_EDICT_DIRTY_PVS_INFORMATION !!!!!!!!");
|
||||
|
||||
// CServerNetworkProperty::GetPVSInfo(): return this + 16;
|
||||
GetEntDataArray(iEntity, g_iNetwork + PVSINFO_OFFSET, view_as<int>(Record.PVSInfo), PVSINFO_SIZE);
|
||||
}
|
||||
@ -942,6 +960,10 @@ void InvalidatePhysicsRecursive(int iEntity, LagRecord Record)
|
||||
fStateFlags |= FL_EDICT_DIRTY_PVS_INFORMATION;
|
||||
SetEdictFlags(iEntity, fStateFlags);
|
||||
*/
|
||||
|
||||
if(GetEdictFlags(iEntity) & FL_EDICT_DIRTY_PVS_INFORMATION)
|
||||
PrintToBoth("RESTORE FL_EDICT_DIRTY_PVS_INFORMATION !!!!!!!!");
|
||||
|
||||
SetEntDataArray(iEntity, g_iNetwork + PVSINFO_OFFSET, view_as<int>(Record.PVSInfo), PVSINFO_SIZE);
|
||||
|
||||
// CollisionProp()->MarkPartitionHandleDirty();
|
||||
|
Loading…
Reference in New Issue
Block a user