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

null check #333

Open
wants to merge 2 commits into
base: 1.0.6.4
Choose a base branch
from
Open

null check #333

wants to merge 2 commits into from

Conversation

Dyvinia
Copy link
Contributor

@Dyvinia Dyvinia commented Jan 23, 2024

No description provided.

@wannkunstbeikor
Copy link
Collaborator

like this it would just ignore assets with handlers, if they are loaded after another mod that only adds it to bundles, so force it to change the entry in modifiedEbx

@wannkunstbeikor
Copy link
Collaborator

also u need to add the same to res and chunk

@Dyvinia
Copy link
Contributor Author

Dyvinia commented Jan 23, 2024

like this it would just ignore assets with handlers, if they are loaded after another mod that only adds it to bundles, so force it to change the entry in modifiedEbx

wdym

@wannkunstbeikor
Copy link
Collaborator

basically the issue is:

  • mod a adds asset to bundle
  • mod b modifies asset with handler

so if mod a is loaded first the stuff mod b does is ignored, just remove the entry from modifiedEbx so it has the correct asset with the handler data

@wannkunstbeikor wannkunstbeikor added the help wanted Extra attention is needed label May 8, 2024
@@ -288,7 +288,7 @@ private void ProcessModResources(IResourceContainer fmod)
HandlerExtraData extraData;
byte[] data = fmod.GetResourceData(resource);

if (modifiedEbx.TryGetValue(resource.Name, out EbxAssetEntry entry))
if (modifiedEbx.TryGetValue(resource.Name, out EbxAssetEntry entry) && entry?.ExtraData != null)
{
extraData = (HandlerExtraData)entry.ExtraData;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (entry != null && entry.ExtraData == null)
{
    if (!archiveData.ContainsKey(entry.Sha1))
    {
        archiveData[entry.Sha1].RefCount--;
        if (archiveData[entry.Sha1].RefCount == 0)
        {
            archiveData.TryRemove(entry.Sha1, out _);
        }
    }
    modifiedEbx.TryRemove(resource.Name, out _);
}

this needs to be added after the else here, ofc also for res and chunks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants