Skip to content
This repository was archived by the owner on Jul 23, 2020. It is now read-only.

Implements EventClass::Execute cases. #281

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions src/game/engine/foot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1569,3 +1569,36 @@ BOOL FootClass::Is_On_Priority_Mission()
{
return m_Mission == MISSION_ENTER;
}

void FootClass::Queue_Navigation_List(target_t target)
{
#ifndef CHRONOSHIFT_STANDALONE
void (*func)(FootClass *, target_t) = reinterpret_cast<void (*)(FootClass *, target_t)>(0x004C35D0);
func(this, target);
#else
int i;
if (target != 0) {
for (i = 0; i < NAV_LENGTH && m_NavList[i] != 0; ++i);
if (target != As_Target() || i <= 0) {
if (i == 0) {
m_Bit2_4 = false;
}
if (i < NAV_LENGTH) {
m_NavList[i] = target;
}
} else {
m_Bit2_4 = true;
}
if (m_NavCom == 0 && Mission == MISSION_GUARD) {
Enter_Idle_Mode();
}
}
#endif
}

void FootClass::Clear_Navigation_List()
{
for (int i = 0; i < NAV_LENGTH; ++i) {
m_NavList[i] = 0;
}
}
8 changes: 8 additions & 0 deletions src/game/engine/foot.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ class FootClass : public TechnoClass
FacingType Get_Path_Facing(int index) const { return m_Paths[index]; }
target_t Nav_Com() const { return m_NavCom; }

void Set_To_Scatter(BOOL state) { m_ToScatter = state; }
void Set_In_Formation(BOOL state) { m_InFormation = state; }
void Set_Team_Speed(SpeedType speed) { m_TeamSpeed = speed; }
void Set_Team_Max_Speed(MPHType mph) { m_TeamMaxSpeed = mph; }
void Set_Suspended_NavCom(target_t target) { m_SuspendedNavCom = target; }

static int Point_Relative_To_Line(int px, int py, int sx, int sy, int ex, int ey);
PathType *Find_Path_Wrapper(cell_t dest, FacingType *buffer, int length, MoveType move);

Expand All @@ -132,6 +138,8 @@ class FootClass : public TechnoClass
#endif

const fixed_t &Get_Speed_Multiplier() const { return m_SpeedMult; }
void Queue_Navigation_List(target_t target);
void Clear_Navigation_List();
const GamePtr<TeamClass> &Get_Team() const { return m_Team; }

protected:
Expand Down
Loading