Skip to content

Commit

Permalink
fix: Add a check for subsystem for better debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Panakotta00 committed Oct 13, 2024
1 parent 0b32d66 commit 22c28d4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Source/FicsItReflection/Private/FicsItReflection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ void UFGRailroadTrackConnectionComponent_RemoveConnection_Hook(CallScope<void(*)

void UFGFactoryConnectionComponent_PeekOutput_Hook(CallScope<bool(*)(const UFGFactoryConnectionComponent*,TArray<FInventoryItem>&,TSubclassOf<UFGItemDescriptor>)>& Scope, const UFGFactoryConnectionComponent* const_self, TArray<FInventoryItem>& out_items, TSubclassOf<UFGItemDescriptor> type) {
UFGFactoryConnectionComponent* self = const_cast<UFGFactoryConnectionComponent*>(const_self);
TOptional<TTuple<FCriticalSection&, FFIRFactoryConnectorSettings&>> OptionalSettings = AFIRSubsystem::GetReflectionSubsystem(self)->GetFactoryConnectorSettings(self);
auto reflectionSubsystem = AFIRSubsystem::GetReflectionSubsystem(self);
fgcheck(reflectionSubsystem);
TOptional<TTuple<FCriticalSection&, FFIRFactoryConnectorSettings&>> OptionalSettings = reflectionSubsystem->GetFactoryConnectorSettings(self);
if (OptionalSettings.IsSet()) {
FFIRFactoryConnectorSettings& Settings = OptionalSettings.GetValue().Value;
if ((Settings.bBlocked && Settings.UnblockedTransfers == 0) || (Settings.AllowedItem != nullptr && Settings.AllowedItem != type)) {
Expand Down

0 comments on commit 22c28d4

Please sign in to comment.