Can anyone fathom why the following code works in a test level:
Code:
result = c_trace(camera.x, temp, IGNORE_YOU|IGNORE_PASSABLE|SCAN_TEXTURE|USE_POLYGON);
you = hit.entity;
if(result > 0)
{
	PARTICLE* p = ent_decal(you, bullethole, 10, random(360));
}



... and yet, when I put the code into practice, the game hard-crashes immediately upon bullet impact?

Code:
bullet_private_var = c_trace(gl_event_source,target_pos, IGNORE_ME|IGNORE_YOU|IGNORE_PASSABLE|IGNORE_PASSENTS|ACTIVATE_SHOOT|SCAN_TEXTURE);
you = hit.entity;
ENTITY* victim = you;
if(trace_hit)
{
	PARTICLE* p = ent_decal(you, "bulhole.tga", 10, 0);
	...



If anybody has ideas, I'd love to hear them.
Incidentally, if I put a bullet hole on an object with a shader, the bullet hole is just a black square with a line down one side. How would I fix that?