Skip to content

Conversation

@f2069
Copy link
Contributor

@f2069 f2069 commented May 20, 2025

The default collectionId is 0.
When GetCache(0, ...) is called for the first time _cache.Count becomes 1 and _cacheCount remains 0.

As a result, we always go into the if (collectionId >= _cacheCount) check and try to fill _cache even though it is already filled.

And when we call ClearPool(), the if (spawnableCollectionId >= _cacheCount) check prevents us from going any further because _cacheCount is 0 and we will never clear the pool.

public void ClearPool(int spawnableCollectionId)
{
    if (spawnableCollectionId >= _cacheCount)
        return;
    // ....
}

With this fix we remember the real size of the cache and solve both problems - we don't try to re-fill the already filled cache and allow to clear the default pool collection.

@FirstGearGames
Copy link
Owner

Ty for this find!

@FirstGearGames FirstGearGames merged commit 2c5b0c5 into FirstGearGames:main Jun 3, 2025
FirstGearGames pushed a commit that referenced this pull request Jun 3, 2025
- Added ForceInstallPreventor -- stops playeveryware EOS plugin from force installing NGO when imported.
- Improved whole number packing.
- Fixed potential for ObjectIds being cached twice for re-use when exceeding 65,000 total spawns.
- Fixed rare BandwidthDisplay NaN conversion error.
- Fixed DefaultObjectPool cacheCount being set to incorrect values (#909).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants