Jump to content

ET Server Suggestion patch this bullet origin/endpoint bug in jaymod + silent


Recommended Posts

Posted

SUGGESTION

The next time you folks compile your custom Jaymod and Silent server/client you should patch this bug.

 

BUG DESCRIPTION

When crouching and shooting at any angle more than 30 degrees below the horizon the bullet origin is incorrect which causes the endpoint to be incorrect as well. The bullet origin when crouched should be at +16 units from the model base but jumps to +30 units when the bug is triggered. This offsets the bullet up above the crosshair by approximately one head height.

 

This can cause accurately placed head shots to be scored as body shots or to miss entirely. The video below demonstrates the bug.

 

 

AFFECTED MODS AND ORIGIN

-- Jaymod 2.2.0 and below
-- Silent 0.9.0 and below
-- ETpub 1.0.0 and below

 

Vanilla ET, Legacy Mod, Nitmod, and NoQuarter above 1.0.2 are not affected

 

The bug appears to have originated in ETpub sometime before 2007 and propagated to other mods when they used some of the ETpub source. A comment at the bugged line, from one of the ETpub creators, tjw, suggests that the bug is a side effect of an effort to make it easier to shoot/stab/revive a player you are directly above. Interestingly, the bug exists in the published source code for NoQuarter but I could not find a version of the mod that was affected.

 

BUG LOCATION

The bug is located in g_weapons in the jaymod and ETpub source codes, presumably it is in the same place in silent mod.

// incorrect code (comments combined and otherwise abbreviated)

void CalcMuzzlePoint ... {
	VectorCopy( ent->r.currentOrigin, muzzlePoint );

	// tjw: if a player is hovering over a wounded player
	//      he should be able to shoot/stab that player
	//      so we need to raise the muzzleOrigin
	//      otherwise the start of the trace will
	//      be inside the wounded player and not find them.
	// Jaybird - adjust for lower bbox
	if(ent->client->ps.viewangles[PITCH] > 30 && (ent->client->ps.eFlags & EF_CROUCHING)) {
		muzzlePoint[2] += 30;
	}
	else {
		muzzlePoint[2] += ent->client->ps.viewheight;
	}
	...
}

// corrected code (braces and style will vary with mod language)

void CalcMuzzlePoint ... {
	VectorCopy( ent->r.currentOrigin, muzzlePoint );
	muzzlePoint[2] += ent->client->ps.viewheight;
	...
}

 

MITIGATIONS

-- Players who are aware of this bug should lower their aim slightly (about one head height) when crouch firing at a downward angle of 30 degrees or more.

-- Firing while standing is not impacted by this bug so standing instead of crouching at steep angles is also a good workaround in many situations.

  • Like 4
  • Thanks 2
  • Surprise 1
  • 100 2
Posted

That explaned for why i cant  a headshot on Cake! not is my blame :)

  • Haha 1
Posted
20 minutes ago, min said:

Odd I noticed hs were super bad over the last few months.

 

That is unlikely to have anything to do with this particular bug since it originated more than 15 years ago.

  • Haha 2

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.