Reverted Svencoop fix

This commit is contained in:
RGreenlees 2024-03-10 22:32:51 +00:00 committed by pierow
parent 14d3e2c54a
commit 3220533c44
2 changed files with 19 additions and 11 deletions

View file

@ -3241,10 +3241,13 @@ void AIPlayerSetMarineSweeperPrimaryTask(AvHAIPlayer* pBot, AvHAIPlayerTask* Tas
if (AITAC_GetNumDeployablesNearLocation(CommChairLocation, &StructureFilter) < 2)
{
Task->TaskType = TASK_GUARD;
Task->TaskLocation = UTIL_GetRandomPointOnNavmeshInRadius(pBot->BotNavInfo.NavProfile, CommChairLocation, UTIL_MetresToGoldSrcUnits(10.0f));
Task->bTaskIsUrgent = false;
Task->TaskLength = frandrange(20.0f, 30.0f);
if (Task->TaskType != TASK_GUARD || vDist2DSq(Task->TaskLocation, CommChairLocation) > UTIL_MetresToGoldSrcUnits(10.0f))
{
Task->TaskType = TASK_GUARD;
Task->TaskLocation = UTIL_GetRandomPointOnNavmeshInRadius(pBot->BotNavInfo.NavProfile, CommChairLocation, UTIL_MetresToGoldSrcUnits(10.0f));
Task->bTaskIsUrgent = false;
Task->TaskLength = frandrange(20.0f, 30.0f);
}
return;
}
@ -3272,10 +3275,13 @@ void AIPlayerSetMarineSweeperPrimaryTask(AvHAIPlayer* pBot, AvHAIPlayerTask* Tas
if (RandomPG)
{
Task->TaskType = TASK_GUARD;
Task->TaskLocation = UTIL_GetRandomPointOnNavmeshInRadius(pBot->BotNavInfo.NavProfile, RandomPG->Location, UTIL_MetresToGoldSrcUnits(5.0f));
Task->bTaskIsUrgent = false;
Task->TaskLength = frandrange(20.0f, 30.0f);
if (Task->TaskType != TASK_GUARD)
{
Task->TaskType = TASK_GUARD;
Task->TaskLocation = UTIL_GetRandomPointOnNavmeshInRadius(pBot->BotNavInfo.NavProfile, RandomPG->Location, UTIL_MetresToGoldSrcUnits(5.0f));
Task->bTaskIsUrgent = false;
Task->TaskLength = frandrange(20.0f, 30.0f);
}
return;
}

View file

@ -271,14 +271,16 @@ BOOL AvHAlienWeapon::IsUseable(void)
float theLatency = 0.0f;
#ifdef AVH_CLIENT
// : 991 -- added latency-based prediction for the ammount of energy available to the alien
//net_status_s current_status;
//gEngfuncs.pNetAPI->Status(&current_status);
net_status_s current_status;
gEngfuncs.pNetAPI->Status(&current_status);
/* svencoop compatibility change. Commented out to avoid conflicts with SDK TOS
net_status_s current_status;
char TestStruct[256]; // Allocate lots of memory to anticipate Svengine's larger size
gEngfuncs.pNetAPI->Status((net_status_s*)&TestStruct);
memcpy(&current_status, TestStruct, sizeof(net_status_s)); // Now copy back the original struct size. This only works if Svengine added to the struct rather than changed it completely
*/
theLatency = max(0.0f, current_status.latency);