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

Fixed issue when yield returning same request #498

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Better access modifiers
  • Loading branch information
Metious committed Dec 2, 2023
commit 9763a6add479cadcbc32d3dd8776f97737e1fe43
8 changes: 4 additions & 4 deletions Nautilus/Assets/ModPrefabRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ namespace Nautilus.Assets;
// request for getting ModPrefab asynchronously
internal class ModPrefabRequest: IPrefabRequest
{
internal bool Done { get; private set; }

private readonly PrefabInfo prefabInfo;

private CoroutineTask<GameObject> task;

private TaskResult<GameObject> taskResult;

internal bool done;

public ModPrefabRequest(PrefabInfo prefabInfo)
{
this.prefabInfo = prefabInfo;
Expand Down Expand Up @@ -52,9 +52,9 @@ public object Current
public bool TryGetPrefab(out GameObject result)
{
result = taskResult.Get();
if (!done)
if (!Done)
{
done = result;
Done = result;
}
return result != null;
}
Expand Down
2 changes: 1 addition & 1 deletion Nautilus/Patchers/PrefabDatabasePatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private static IPrefabRequest GetModPrefabAsync(string classId)

if(ModPrefabCache.Requests.TryGetValue(prefabInfo.ClassID, out var request))
{
if (request.done && !request.TryGetPrefab(out _))
if (request.Done && !request.TryGetPrefab(out _))
{
return new ModPrefabRequest(prefabInfo);
}
Expand Down