Skip to content

Fixed WMI being broken after engine savegame restore.#3647

Merged
Astralcircle merged 2 commits into
wiremod:masterfrom
Grocel:master
Jul 9, 2026
Merged

Fixed WMI being broken after engine savegame restore.#3647
Astralcircle merged 2 commits into
wiremod:masterfrom
Grocel:master

Conversation

@Grocel

@Grocel Grocel commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

About

Turns out engine save games store the entire entity table, with no way to filter them before hand. This leads to partly applied entity states. Like that entities having certain values but not others such as functions or certain usertypes. It results in a broken override state. To fix this I changed the system to also check for certain functions to exist before (re-)applying the custom logic.

Fixed lua errors:

Can't save or load unknown type CRecipientFilter
    1. GetType - lua/includes/modules/saverestore.lua:94
        2. IsWritable - lua/includes/modules/saverestore.lua:120
            3. WritableKeysInTable - lua/includes/modules/saverestore.lua:137
                4. WriteTable - lua/includes/modules/saverestore.lua:245
                    5. unknown - lua/includes/modules/saverestore.lua:324
                    
[wire] addons/wire/lua/entities/info_wiremapinterface/networking.lua:65: attempt to index local 'recipientFilter' (a nil value)
    1. RequestNetworkEntities - addons/wire/lua/entities/info_wiremapinterface/networking.lua:65
        2. resetNetworking - addons/wire/lua/entities/info_wiremapinterface/networking.lua:12
            3. v - addons/wire/lua/entities/info_wiremapinterface/networking.lua:22
                4. unknown - lua/includes/modules/hook.lua:102

Why does this need a fix?

It has been said that Wiremod does not support engine save games. But especially when mapping (important use case of the Wire Map Interface), the engine might create save games on multiple occurrences during map builds or tests. The WMI should still work in those cases, or at least do not throw Lua errors.

Info about WMI

https://github.com/wiremod/wire/wiki/Wire-Map-Interface

Turns out engine savegames store the entire entity table, with no way to filter them before hand. This leads to partly applied entity states. Like that entities having certain values but not others such as functions. It results in a broken override state. To fix this I changed the system to also check for certain functions to exist before (re-)applying the custom logic.
@BlackIceKB

Copy link
Copy Markdown

This would be so helpful when using other save games that are using wiremod and not breaking it.

@DarthTealc DarthTealc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I noticed this error the other day when changing a video setting, which reloads the map using the engine savegame restore system.

Checked with and without this PR, and can confirm this PR prevents these errors.

@Astralcircle Astralcircle merged commit a645ca4 into wiremod:master Jul 9, 2026
1 check passed
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.

4 participants