Skip to content

Fixed WMI being broken after engine savegame restore.#3647

Open
Grocel wants to merge 1 commit into
wiremod:masterfrom
Grocel:master
Open

Fixed WMI being broken after engine savegame restore.#3647
Grocel wants to merge 1 commit 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.

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.

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