Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CCover #621

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
6 changes: 4 additions & 2 deletions source/game_sa/Cover.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ void CCover::InjectHooks() {
RH_ScopedClass(CCover);
RH_ScopedCategoryGlobal();

RH_ScopedInstall(Init, 0x698710, {.reversed = false});
RH_ScopedInstall(Init, 0x698710);
RH_ScopedInstall(RemoveCoverPointIfEntityLost, 0x698DB0, {.reversed = false});
RH_ScopedInstall(RemoveCoverPointsForThisEntity, 0x698740, {.reversed = false});
RH_ScopedInstall(ShouldThisBuildingHaveItsCoverPointsCreated, 0x699230);
Expand All @@ -29,7 +29,9 @@ void CCover::InjectHooks() {
void CCover::Init() {
ZoneScoped;

plugin::Call<0x698710>();
m_NumPoints = 0;
m_ListOfProcessedBuildings.Flush();
rng::fill(m_aPoints, CCoverPoint{});
}

// unused
Expand Down
18 changes: 9 additions & 9 deletions source/game_sa/CoverPoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ class CPed;

class CCoverPoint {
public:
char m_nMaxPedsInCover;
char m_nCoverType;
char m_nDirection;
char _pad3;
CVector m_vecOffset;
CEntity* m_pCoverEntity;
CPed* m_apCoveredPeds[2];
CCoverPoint() = default;

public:
bool CanAccomodateAnotherPed();
void ReleaseCoverPointForPed(CPed* ped);
void ReserveCoverPointForPed(CPed* ped);
};

public:
char m_nMaxPedsInCover{};
char m_nCoverType{};
char m_nDirection{};
CVector m_vecOffset{};
CEntity* m_pCoverEntity{};
CPed* m_apCoveredPeds[2]{};
};
VALIDATE_SIZE(CCoverPoint, 0x1C);
Loading