mirror of
https://github.com/ENSL/NS.git
synced 2025-02-21 11:21:55 +00:00
Weld tweak
This commit is contained in:
parent
c6344df589
commit
67903b598e
2 changed files with 19 additions and 8 deletions
|
@ -8643,9 +8643,11 @@ void NAV_ProgressMovementTask(AvHAIPlayer* pBot)
|
||||||
{
|
{
|
||||||
Vector AimLocation;
|
Vector AimLocation;
|
||||||
|
|
||||||
if (MoveTask->TaskTarget->v.size.Length2D() < 100.0f)
|
Vector EntityCentre = UTIL_GetCentreOfEntity(MoveTask->TaskTarget);
|
||||||
|
|
||||||
|
if (MoveTask->TaskTarget->v.size.Length() < 100.0f)
|
||||||
{
|
{
|
||||||
AimLocation = UTIL_GetCentreOfEntity(MoveTask->TaskTarget);
|
AimLocation = EntityCentre;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -8655,9 +8657,16 @@ void NAV_ProgressMovementTask(AvHAIPlayer* pBot)
|
||||||
vScaleBB(BBMin, BBMax, 0.75f);
|
vScaleBB(BBMin, BBMax, 0.75f);
|
||||||
|
|
||||||
AimLocation = vClosestPointOnBB(pBot->CurrentEyePosition, BBMin, BBMax);
|
AimLocation = vClosestPointOnBB(pBot->CurrentEyePosition, BBMin, BBMax);
|
||||||
|
|
||||||
|
if (MoveTask->TaskTarget->v.absmax.z - MoveTask->TaskTarget->v.absmin.z < 100.0f)
|
||||||
|
{
|
||||||
|
AimLocation.z = EntityCentre.z;
|
||||||
}
|
}
|
||||||
|
|
||||||
BotLookAt(pBot, AimLocation);
|
UTIL_DrawLine(INDEXENT(1), pBot->CurrentEyePosition, AimLocation);
|
||||||
|
}
|
||||||
|
|
||||||
|
BotMoveLookAt(pBot, AimLocation);
|
||||||
pBot->DesiredCombatWeapon = WEAPON_MARINE_WELDER;
|
pBot->DesiredCombatWeapon = WEAPON_MARINE_WELDER;
|
||||||
|
|
||||||
if (GetPlayerCurrentWeapon(pBot->Player) != WEAPON_MARINE_WELDER)
|
if (GetPlayerCurrentWeapon(pBot->Player) != WEAPON_MARINE_WELDER)
|
||||||
|
@ -8673,10 +8682,6 @@ void NAV_ProgressMovementTask(AvHAIPlayer* pBot)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
MoveTo(pBot, MoveTask->TaskLocation, MOVESTYLE_NORMAL);
|
MoveTo(pBot, MoveTask->TaskLocation, MOVESTYLE_NORMAL);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2472,7 +2472,8 @@ void BotProgressWeldTask(AvHAIPlayer* pBot, AvHAIPlayerTask* Task)
|
||||||
|
|
||||||
if (IsPlayerInUseRange(pBot->Edict, Task->TaskTarget))
|
if (IsPlayerInUseRange(pBot->Edict, Task->TaskTarget))
|
||||||
{
|
{
|
||||||
Vector AimLocation = UTIL_GetCentreOfEntity(Task->TaskTarget);
|
Vector EntityCentre = UTIL_GetCentreOfEntity(Task->TaskTarget);
|
||||||
|
Vector AimLocation = EntityCentre;
|
||||||
|
|
||||||
// If we're targeting a func_weldable, then the centre of the entity might be in a wall or out of reach
|
// If we're targeting a func_weldable, then the centre of the entity might be in a wall or out of reach
|
||||||
// so instead aim at the closest point on the func_weldable to us.
|
// so instead aim at the closest point on the func_weldable to us.
|
||||||
|
@ -2490,6 +2491,11 @@ void BotProgressWeldTask(AvHAIPlayer* pBot, AvHAIPlayerTask* Task)
|
||||||
vScaleBB(BBMin, BBMax, 0.75f);
|
vScaleBB(BBMin, BBMax, 0.75f);
|
||||||
|
|
||||||
AimLocation = vClosestPointOnBB(pBot->CurrentEyePosition, BBMin, BBMax);
|
AimLocation = vClosestPointOnBB(pBot->CurrentEyePosition, BBMin, BBMax);
|
||||||
|
|
||||||
|
if (Task->TaskTarget->v.absmax.z - Task->TaskTarget->v.absmin.z < 100.0f)
|
||||||
|
{
|
||||||
|
AimLocation.z = EntityCentre.z;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue