Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when loading a save with spaz_effect_count set #746

Closed
lahm86 opened this issue Mar 4, 2023 · 3 comments
Closed

Crash when loading a save with spaz_effect_count set #746

lahm86 opened this issue Mar 4, 2023 · 3 comments
Assignees
Labels
OG bug A bug in original game TR1
Milestone

Comments

@lahm86
Copy link
Collaborator

lahm86 commented Mar 4, 2023

If the game is saved while Lara is in the following animation and then reloaded, a crash occurs. This is present in TombATI as well as T1M (found by Radgryd during randomizer testing).

20230304_144736_Atlantis_6

Saving during Lara's normal animation doesn't lead to a crash.
20230304_144737_Atlantis

The cause I think is that while spaz_effect_count and spaz_effect are saved, only spaz_effect_count is restored.

The crash seems to occur below as g_Lara.spaz_effect_count is used in the condition, but g_Lara.spaz_effect is assumed to be set.

https://github.com/LostArtefacts/Tomb1Main/blob/develop/src/game/lara/lara_control.c#L158

@lahm86 lahm86 added the OG bug A bug in original game label Mar 4, 2023
@lahm86
Copy link
Collaborator Author

lahm86 commented Mar 4, 2023

Savefile for Atlantis for reference.
save_tr1_15.zip

@walkawayy
Copy link
Collaborator

Looks like it's a NULL pointer issue. Just trying to print g_Lara.spaz_effect->pos.x on load causes a crash. spaz_effect gets set to FX_INFO *fx = &g_Effects[fx_num]; depending on what caused it. Looks like that isn't being saved and restored properly in legacy or new save format.

@lahm86 lahm86 self-assigned this Mar 9, 2023
lahm86 added a commit to lahm86/TRX that referenced this issue Mar 9, 2023
@lahm86 lahm86 added this to the 2.14 milestone Mar 9, 2023
@lahm86 lahm86 mentioned this issue Mar 9, 2023
2 tasks
@lahm86 lahm86 modified the milestones: 2.14, 2.13.2 Mar 10, 2023
rr- pushed a commit that referenced this issue Mar 10, 2023
@rr-
Copy link
Collaborator

rr- commented Mar 10, 2023

Fixed in 2.13.2

@rr- rr- closed this as completed Mar 10, 2023
@rr- rr- added the TR1 label Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OG bug A bug in original game TR1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants