Skip to content
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
1 change: 1 addition & 0 deletions docs/Whats-New.md
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,7 @@ Phobos fixes:
- Fixed combat light ignoring / behaving differently from vanilla game regarding detail level and framerate checks (by Starkku)
- Fixed a bug causing transfering AttachEffects (e.g on `DeploysInto`/`UndeploysInto`) not to immediately recalculate stats or tint (by Starkku)
- Fixed a bug where updating the `OpenTopped` attribute during convert did not update the coordinates of passengers (by NetsuNegi)
- Fixed the bug where the `.SubjectToGround` of the Trajectory type did not consider bridges (by Noble_Fish)
Fixes / interactions with other extensions:
<!-- - Allowed `AuxBuilding` and Ares' `SW.Aux/NegBuildings` to count building upgrades (by Ollerus) -->
Expand Down
5 changes: 5 additions & 0 deletions src/Ext/Bullet/Trajectories/BombardTrajectory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -610,3 +610,8 @@ void BombardTrajectory::RefreshBulletLineTrail(BulletClass* pBullet)
pLineTrailer->Owner = pBullet;
}
}

bool BombardTrajectory::ShouldSkipBridgeCheck() const
{
return !this->Type->SubjectToGround;
}
1 change: 1 addition & 0 deletions src/Ext/Bullet/Trajectories/BombardTrajectory.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class BombardTrajectory final : public PhobosTrajectory
virtual void OnAIVelocity(BulletClass* pBullet, BulletVelocity* pSpeed, BulletVelocity* pPosition) override;
virtual TrajectoryCheckReturnType OnAITargetCoordCheck(BulletClass* pBullet) override;
virtual TrajectoryCheckReturnType OnAITechnoCheck(BulletClass* pBullet, TechnoClass* pTechno) override;
virtual bool ShouldSkipBridgeCheck() const override;

const BombardTrajectoryType* Type;
double Height;
Expand Down
20 changes: 20 additions & 0 deletions src/Ext/Bullet/Trajectories/PhobosTrajectory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,26 @@ DEFINE_HOOK(0x4666F7, BulletClass_AI_Trajectories, 0x6)
return 0;
}

/* ROT > 0. We temporarily do not need to make changes to the Bridge interaction for this scenario, but we will leave it here for now, as it may be used later.
DEFINE_HOOK(0x46703E, BulletClass_AI_SkipBridgeCheck1, 0x6)
{
GET(BulletClass*, pThis, EBP);
auto const pExt = BulletExt::ExtMap.Find(pThis);
if (pExt && pExt->Trajectory)
return 0x467B7A;
return 0;
}
*/

DEFINE_HOOK(0x4674D4, BulletClass_AI_SkipBridgeCheck2, 0x6)
{
GET(BulletClass*, pThis, EBP);
auto const pExt = BulletExt::ExtMap.Find(pThis);
if (pExt && pExt->Trajectory && pExt->Trajectory->ShouldSkipBridgeCheck())
return 0x467519;
return 0;
}

DEFINE_HOOK(0x467E53, BulletClass_AI_PreDetonation_Trajectories, 0x6)
{
GET(BulletClass*, pThis, EBP);
Expand Down
1 change: 1 addition & 0 deletions src/Ext/Bullet/Trajectories/PhobosTrajectory.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class PhobosTrajectory
virtual void OnAIVelocity(BulletClass* pBullet, BulletVelocity* pSpeed, BulletVelocity* pPosition) = 0;
virtual TrajectoryCheckReturnType OnAITargetCoordCheck(BulletClass* pBullet) = 0;
virtual TrajectoryCheckReturnType OnAITechnoCheck(BulletClass* pBullet, TechnoClass* pTechno) = 0;
virtual bool ShouldSkipBridgeCheck() const { return false; }
};

/*
Expand Down
5 changes: 5 additions & 0 deletions src/Ext/Bullet/Trajectories/StraightTrajectory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1054,3 +1054,8 @@ bool StraightTrajectory::PassAndConfineAtHeight(BulletClass* pBullet)

return false;
}

bool StraightTrajectory::ShouldSkipBridgeCheck() const
{
return !this->Type->SubjectToGround;
}
1 change: 1 addition & 0 deletions src/Ext/Bullet/Trajectories/StraightTrajectory.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class StraightTrajectory final : public PhobosTrajectory
virtual void OnAIVelocity(BulletClass* pBullet, BulletVelocity* pSpeed, BulletVelocity* pPosition) override;
virtual TrajectoryCheckReturnType OnAITargetCoordCheck(BulletClass* pBullet) override;
virtual TrajectoryCheckReturnType OnAITechnoCheck(BulletClass* pBullet, TechnoClass* pTechno) override;
virtual bool ShouldSkipBridgeCheck() const override;

const StraightTrajectoryType* Type;
Leptons DetonationDistance;
Expand Down
Loading