Skip to content

Conversation

@Kappa971
Copy link

@Kappa971 Kappa971 commented May 8, 2024

I'm having a pretty bad crash in the "Trenches" level when I destroy a turret with the revolver.
This doesn't happen with the precompiled v2.2.1. The latest working build is with the commit: 71f14cd
The commit af636f5 makes impossible to load the savegame. The savegame crash was fixed in commit 4ab826e but here there is the crash mentioned above with turret explosions.

This is the savegame file: savegame.zip
Load it, aim with the revolver by pressing the PAD0 and shoot the small white tank positioned behind the turret, the game will crash with the latest build compiled from master branch.

Let me start by saying that I'm not a programmer, I only have very basic knowledge of C++, I looked for a simple solution that would allow me to complete the game. For the moment I have not experienced any other crashes.
The crash seems to be caused by these two pieces of code in output.cpp:

...

void ProcessObjectMeshVertices(MESH_DATA* mesh)
{

                ...

		if (current_item)
		{
			if (!(room[current_item->room_number].flags & ROOM_UNDERWATER) && camera.underwater)
			{
				cR = (cR * water_color_R) >> 8;
				cG = (cG * water_color_G) >> 8;
				cB = (cB * water_color_B) >> 8;
			}
		}

                ...

}

...
...

void phd_PutPolygonSkyMesh(short* objptr, long clipstatus)
{

        ...

	current_item = 0;
        ProcessObjectMeshVertices(mesh);

        ...

}

...

Anyway, I managed to prevent the game from crashing after the turret explosion moving current_item = 0;.

I attach the compiled executable for testing (the "crocodile underwater death animation" fix by TokyoSU is also included): tomb4.zip

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.

1 participant