Skip to content

Commit

Permalink
save/load system corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
lostsquirrel1 committed Feb 9, 2025
1 parent 095b4a4 commit c956e47
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
5 changes: 0 additions & 5 deletions rts/Sim/MoveTypes/Components/MoveTypesComponents.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ void serializeComponents(Archive &archive, Snapshot &snapshot) {
>(archive);
}

struct GroundMoveSystemComponent {
static constexpr std::size_t page_size = 1;
static constexpr std::size_t INITIAL_TRAP_UNIT_LIST_ALLOC_SIZE = 64;
};

struct YardmapTrapCheckSystemComponent {
static constexpr std::size_t page_size = 1;
static constexpr std::size_t INITIAL_TRAP_UNIT_LIST_ALLOC_SIZE = 8;
Expand Down
2 changes: 0 additions & 2 deletions rts/Sim/MoveTypes/GroundMoveType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2771,7 +2771,6 @@ void CGroundMoveType::HandleUnitCollisions(
const bool allowSAT = modInfo.allowSepAxisCollisionTest;
const bool forceSAT = (colliderParams.z > 0.1f);

auto& comp = Sim::systemGlobals.GetSystemComponent<GroundMoveSystemComponent>();
const float3 crushImpulse = owner->speed * owner->mass * Sign(int(!reversing));

// Push resistent units when stopped impacting pathing and also cannot be pushed, so it is important that such
Expand Down Expand Up @@ -2989,7 +2988,6 @@ void CGroundMoveType::HandleFeatureCollisions(
const bool allowSAT = modInfo.allowSepAxisCollisionTest;
const bool forceSAT = (colliderParams.z > 0.1f);

auto& comp = Sim::systemGlobals.GetSystemComponent<GroundMoveSystemComponent>();
const float3 crushImpulse = owner->speed * owner->mass * Sign(int(!reversing));
MoveTypes::CheckCollisionQuery colliderInfo(collider);

Expand Down
5 changes: 4 additions & 1 deletion rts/Sim/MoveTypes/Systems/GeneralMoveSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ using namespace MoveTypes;
void GeneralMoveSystem::Init() {
RECOIL_DETAILED_TRACY_ZONE;
CMoveMath::InitRangeIsBlockedHashes();
Sim::systemUtils.OnPostLoad().connect<&CMoveMath::InitRangeIsBlockedHashes>();
}

void GeneralMoveSystem::Update() {
Expand Down Expand Up @@ -54,4 +55,6 @@ void GeneralMoveSystem::Update() {
}
}

void GeneralMoveSystem::Shutdown() {}
void GeneralMoveSystem::Shutdown() {
Sim::systemUtils.OnPostLoad().disconnect<&CMoveMath::InitRangeIsBlockedHashes>();
}
6 changes: 1 addition & 5 deletions rts/Sim/MoveTypes/Systems/GroundMoveSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@

using namespace MoveTypes;

void GroundMoveSystem::Init() {
Sim::systemGlobals.CreateSystemComponent<GroundMoveSystemComponent>();
}
void GroundMoveSystem::Init() {}

template<typename T, typename F>
void issue_events(F func)
Expand All @@ -32,8 +30,6 @@ void issue_events(F func)
}

void GroundMoveSystem::Update() {
auto& comp = Sim::systemGlobals.GetSystemComponent<GroundMoveSystemComponent>();

// TODO: GroundMove could become a component (or series of components) and then the extra indirection wouldn't be
// needed. Though that will be a bigger change.
{
Expand Down

0 comments on commit c956e47

Please sign in to comment.