Skip to content

Fix TpvScene3D.TLight.BeforeDestruction#53

Open
michaliskambi wants to merge 1 commit intoBeRo1985:masterfrom
michaliskambi:master
Open

Fix TpvScene3D.TLight.BeforeDestruction#53
michaliskambi wants to merge 1 commit intoBeRo1985:masterfrom
michaliskambi:master

Conversation

@michaliskambi
Copy link
Copy Markdown

Code in TpvScene3D.TLight.BeforeDestruction was accidentally doing

fSceneInstance.fManualLights[fIndex]:=OtherLight;

when fIndex is obviously -1 (set to -1 by finally clause a few lines higher).

This was causing range check errors when destroying certain animals in our game:)

It seems that it's a copy-paste error, the code under if fManualIndex>=0 then begin seems mostly a copy-paste of the code under if fIndex>=0 then begin, you possibly copied it and didn't adjust all occurences of fIndex -> fManualIndex?

Tested the solution on our game, and destroying some animals crashes no more:)

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