Clear the edict model when freeing the edict
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 15s

This fixes an issue where configstrings or game state chars would overflow when many models (such as actors with random headmodels/headskins) are spawned
This commit is contained in:
smallmodel 2025-02-04 21:28:37 +01:00
parent ee385abfef
commit c77fcd2cbc
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512

View file

@ -1754,6 +1754,10 @@ void Level::FreeEdict(gentity_t *ed)
{ {
gclient_t *client; gclient_t *client;
// clear the model so it decreases the user count
// and free memory if the model is not used anywhere
gi.clearmodel(ed);
// unlink from world // unlink from world
gi.unlinkentity(ed); gi.unlinkentity(ed);