Skip to content

Fix that weird null pointer bug for the Half-Life 2: Deathmatch bots#1883

Open
engineergamingistaking wants to merge 1 commit intoValveSoftware:masterfrom
engineergamingistaking:master
Open

Fix that weird null pointer bug for the Half-Life 2: Deathmatch bots#1883
engineergamingistaking wants to merge 1 commit intoValveSoftware:masterfrom
engineergamingistaking:master

Conversation

@engineergamingistaking
Copy link
Copy Markdown

This fixes that weird null pointer bug that happens when the bots pick up a null physics object.

{
mass = MIN(mass, 1000.0f);
float flForceMin = physcannon_minforce.GetFloat();
flForce = SimpleSplineRemapVal(mass, 100.0f, 600.0f, flForceMax, flForceMin);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Just want to mention that the formatting seems to have changed, maybe try to re-add the spaces for ( & ) to stay consistent with the code? :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like spaces were used instead of tabs

Comment on lines +285 to +294
if (pPhysObj)
{
float mass = pPhysObj->GetMass();
if (mass > 100.0f)
{
mass = MIN(mass, 1000.0f);
float flForceMin = physcannon_minforce.GetFloat();
flForce = SimpleSplineRemapVal(mass, 100.0f, 600.0f, flForceMax, flForceMin);
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (pPhysObj)
{
float mass = pPhysObj->GetMass();
if (mass > 100.0f)
{
mass = MIN(mass, 1000.0f);
float flForceMin = physcannon_minforce.GetFloat();
flForce = SimpleSplineRemapVal(mass, 100.0f, 600.0f, flForceMax, flForceMin);
}
}
if ( pPhysObj )
{
float mass = pPhysObj->GetMass();
if ( mass > 100.f )
{
mass = MIN( mass, 1000.f );
float flForceMin = physcannon_minforce.GetFloat();
flForce = SimpleSplineRemapVal( mass, 100.f, 600.f, flForceMax, flForceMin );
}
}

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.

3 participants