shinyquagsire23 / OpenJKDF2

A cross-platform reimplementation of JKDF2 in C
Other
508 stars 42 forks source link

[Bug] Thing moveType Not Synced in sithDSSThing_ThingFullDesc #334

Open smlu opened 3 months ago

smlu commented 3 months ago

This is a vanilla bug that occurs in the game Indiana Jones and the Infernal Machine. It has been cross-checked with the OpenJKDF2 source code and is assumed to be affected as well, although this has not been tested.

The moveType property of a Thing is not synced correctly in the sithDSSThing_SendFullDesc function. This leads to a bug where the moveType set via thing parameters or changed through the COG function ParseArg is not preserved when the game is restored from a saved state.

Steps to Reproduce:

1.) Define a static Thing with a specific moveType using thing parameters. Alternatively, change the moveType of a Thing dynamically using the COG function ParseArg. 2.) Save the game. 3.) Restore the game from the saved state. 4.) Observe that the moveType of the Thing is not correctly restored.

Expected Behavior:

The moveType property should be correctly synced and restored when the game state is saved and restored, ensuring consistent behavior for Things.

Actual Behavior:

The moveType property is not synced in sithDSSThing_SendFullDesc / sithDSSThing_ProcessFullDesc, resulting in the moveType value reverting back to the template value for Things upon game restore.

Logical flow:

  1. Thing moveType is changed from the template value either when defining static level thing or via ParseArg COG function
  2. Game saved, thing synced via sithDSSThing_SendFullDesc
  3. Game restored via sithGamesave_LoadEntry: a.) Loads level via sithMain_OpenNormal: sithGamesave_LoadEntry:170 b.) Remove all static defined things of loaded level via sithThing_freestuff: sithGamesave_LoadEntry:204 c.) Restore thing via sithDSSThing_ProcessFullDesc which resets move type to template value

_Note, since sithDSSThing_SendFullDesc & sithDSSThing_ProcessFullDesc functions are used to sync thing over net it is assumed that multiplayer game could be also affected by this bug._