1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-06-18 11:23:13 +00:00
This commit is contained in:
Nikolay Korolev 2021-01-11 02:35:03 +03:00
parent 642970df95
commit 53a99cb9ee
5 changed files with 487 additions and 389 deletions

File diff suppressed because it is too large Load diff

View file

@ -2556,7 +2556,7 @@ void CTheScripts::SetObjectiveForAllPedsInCollective(int colIndex, eObjective ob
}
else {
pPed->bScriptObjectiveCompleted = false;
//pPed->SetObjective(objective, p1, p2); TODO!
pPed->SetObjective(objective, p1, p2);
}
}
}

View file

@ -334,7 +334,7 @@ static_assert(false, "SUPPORT_XBOX_SCRIPT and SUPPORT_MOBILE_SCRIPT are mutually
#endif
//#define SIMPLIER_MISSIONS // apply simplifications from mobile
#define USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
#define SCRIPT_LOG_FILE_LEVEL 0 // 0 == no log, 1 == overwrite every frame, 2 == full log
#define SCRIPT_LOG_FILE_LEVEL 2 // 0 == no log, 1 == overwrite every frame, 2 == full log
#ifndef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
#define USE_BASIC_SCRIPT_DEBUG_OUTPUT

View file

@ -744,6 +744,7 @@ public:
void SetObjective(eObjective);
void SetObjective(eObjective, int16, int16);
void SetObjective(eObjective, CVector);
void SetObjective(eObjective, CVector, float);
void SetObjective(eObjective, float, const CVector&);
void ClearChat(void);
void InformMyGangOfAttack(CEntity*);

View file

@ -370,6 +370,51 @@ CPed::SetObjective(eObjective newObj, void *entity)
}
}
void
CPed::SetObjective(eObjective newObj, CVector dest, float safeDist)
{
if (DyingOrDead())
return;
if (m_prevObjective != OBJECTIVE_NONE && m_prevObjective == newObj)
return;
if (m_objective == newObj) {
if (newObj == OBJECTIVE_GOTO_AREA_ANY_MEANS || newObj == OBJECTIVE_GOTO_AREA_ON_FOOT || newObj == OBJECTIVE_RUN_TO_AREA || newObj == OBJECTIVE_SPRINT_TO_AREA) {
if (m_nextRoutePointPos == dest && m_distanceToCountSeekDone == safeDist)
return;
}
else if (newObj == OBJECTIVE_GUARD_SPOT) {
if (m_vecSpotToGuard == dest && m_radiusToGuard == safeDist)
return;
}
}
ClearPointGunAt();
SetObjectiveTimer(0);
bObjectiveCompleted = false;
if (IsTemporaryObjective(m_objective)) {
m_prevObjective = newObj;
}
else {
if (m_objective != newObj)
SetStoredObjective();
m_objective = newObj;
}
if (newObj == OBJECTIVE_GUARD_SPOT) {
m_vecSpotToGuard = dest;
m_radiusToGuard = safeDist;
}
else if (newObj == OBJECTIVE_GOTO_AREA_ANY_MEANS || newObj == OBJECTIVE_GOTO_AREA_ON_FOOT || newObj == OBJECTIVE_RUN_TO_AREA || newObj == OBJECTIVE_SPRINT_TO_AREA) {
m_pNextPathNode = nil;
m_nextRoutePointPos = dest;
m_vecSeekPos = m_nextRoutePointPos;
bUsePedNodeSeek = true;
}
}
// --MIAMI: Done
// Only used in 01E1: SET_CHAR_OBJ_FOLLOW_ROUTE opcode
// IDA fails very badly in here, puts a fake loop and ignores SetFollowRoute call...