Complete disaster-recovery snapshot: engine/game source, game data assets, VC6 toolchain + DX SDKs, build outputs, deployed game, and _UNUSED archive. Large binaries in Git LFS; text preserved byte-for-byte (core.autocrlf=false, no eol attributes). See RECOVERY.md for the one-clone rebuild procedure.
61 lines
923 B
C++
61 lines
923 B
C++
#include "MW4Headers.hpp"
|
|
|
|
#include "AI_SearchLight.hpp"
|
|
|
|
#include <Adept\Mission.hpp>
|
|
#include "CombatAI.hpp"
|
|
|
|
|
|
|
|
using namespace MW4AI;
|
|
|
|
SearchLightController::SearchLightController(CombatAI& combat_ai)
|
|
: m_CombatAI(combat_ai)
|
|
, m_State(UNSPECIFIED)
|
|
{
|
|
}
|
|
|
|
void SearchLightController::Update()
|
|
{
|
|
bool on = false;
|
|
|
|
if (m_State == ON)
|
|
{
|
|
on = true;
|
|
}
|
|
else
|
|
{
|
|
if (m_State == UNSPECIFIED)
|
|
{
|
|
Adept::Mission* mission = Adept::Mission::GetInstance();
|
|
|
|
if (mission != 0)
|
|
{
|
|
on = mission->m_isNightMission;
|
|
}
|
|
}
|
|
}
|
|
|
|
if (on == m_CombatAI.GetSelf().IsSearchLightOn())
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (on == true)
|
|
{
|
|
m_CombatAI.GetSelf().TurnOnSearchLight();
|
|
}
|
|
else
|
|
{
|
|
m_CombatAI.GetSelf().TurnOffSearchLight();
|
|
}
|
|
}
|
|
|
|
void SearchLightController::SetState(State state)
|
|
{
|
|
Verify(state >= STATE_FIRST);
|
|
Verify(state <= STATE_LAST);
|
|
|
|
m_State = state;
|
|
}
|