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

Fix Visual Studio crashes related to nans and uninitialized variables. #107

Merged
merged 1 commit into from
Feb 12, 2024

Conversation

rohit-n
Copy link
Collaborator

@rohit-n rohit-n commented May 30, 2023

Specifically, this fixes a crash when exploding the gas tank in the inner yard in Chapter 5.

@@ -278,6 +278,12 @@ void CSFXMgr::HandleSFXMsg(HLOCALOBJ hObj, ILTMessage_Read *pMsg)
debris.vPos = pMsg->ReadCompPos();
debris.nDebrisId = pMsg->Readuint8();

if (std::isnan(debris.rRot.m_Quat[0]) || std::isnan(debris.rRot.m_Quat[1])
|| std::isnan(debris.rRot.m_Quat[2]) || std::isnan(debris.rRot.m_Quat[3]))
Copy link
Owner

@Katana-Steel Katana-Steel Jun 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe have the logical or at the end of the previous line than at the beginning of the...
it would more clearly convey that the tests are continuing on the next line.
and LTRotation has a [] operator to access the m_Quat member instead of accessing it directly:
https://github.com/Katana-Steel/lithtech/blob/linux-x86_64/sdk/inc/ltrotation.h#L133

Specifically, this fixes a crash when exploding the gas tank in the
inner yard in Chapter 5.
@rohit-n
Copy link
Collaborator Author

rohit-n commented Feb 6, 2024

Changes made, sorry for the long delay!

@Katana-Steel Katana-Steel merged commit a8cf3dd into Katana-Steel:linux-x86_64 Feb 12, 2024
1 check passed
@Katana-Steel
Copy link
Owner

No worries, your time is yours. Thank you.

@rohit-n rohit-n deleted the vsfixes branch February 15, 2024 04:58
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