Skip to content

Commit

Permalink
Garrison Achievement Implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Xynth22 committed Nov 9, 2017
1 parent e3928d2 commit bd94b24
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/FedSrv/CSteamAchievements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,8 @@ void CSteamAchievements::AwardIGCAchievements(AchievementMask am)
SetAchievement(EAchievements::NANITE_REPAIR_1_11);
m_nanAchievementEarned = true; //I was concerned about potentially calling set achievement too much
}
if ((am & c_achmGarrSpot) > 0)
SetAchievement(EAchievements::SPOT_GARRISON_1_14);

}

Expand Down
19 changes: 18 additions & 1 deletion src/FedSrv/FedSrv.CPP
Original file line number Diff line number Diff line change
Expand Up @@ -10885,10 +10885,27 @@ class ThingSiteImpl : public ThingSite
pfmObjectSpotted->oidObject = pmodel->GetObjectID();
pfmObjectSpotted->otSpotter = otSpotter;
pfmObjectSpotted->oidSpotter = s->GetObjectID();

g.fm.SendMessages(CFSSide::FromIGC(pside)->GetGroup(), FM_GUARANTEED, FM_FLUSH);

CFSMission* pfsMission = (CFSMission *)(pside->GetMission()->GetPrivateData());

if (otModel == OT_station)
{
IstationIGC* pstation = ((IstationIGC*)pmodel);
if ((pstation->GetStationType()->GetClassID() == c_scGarrison) ||
(pstation->GetStationType()->GetClassID() == c_scStarbase))
{
if (s->GetObjectType() == OT_ship)
{
ObjectID spotterID = s->GetObjectID();
ImodelIGC* pShipModel = s->GetMission()->GetModel(OT_ship, spotterID);
IshipIGC* pShip = (IshipIGC*)pShipModel;
pShip->SetAchievementMask(c_achmGarrSpot);
}
}
}


if ((otModel == OT_warp) || (otModel == OT_asteroid))
{
Expand Down
1 change: 1 addition & 0 deletions src/Igc/igc.h
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,7 @@ typedef short AchievementMask;
const AchievementMask c_achmProbeKill = 0x01;
const AchievementMask c_achmProbeSpot = 0x02;
const AchievementMask c_achmNewRepair = 0x04;
const AchievementMask c_achmGarrSpot = 0x08;

enum ShipControlStateIGC
{
Expand Down

0 comments on commit bd94b24

Please sign in to comment.