I have a feeling that this is a futile plea, but if anyone out there is familiar with the Quake 2 source code and willing to help me, please drop me a line. I'm using the Quake 2 graphics/physics engine for my PhD dissertation, and I'm having some problems with one of John Carmack's collision detection functions.

Specifically, in the SV_AreaEdicts_r() function in sv_world.c, there is a loop as so:

for (l=start->next ; l != start ; l = next)
next = l->next;
check = EDICT_FROM_AREA(l);

if (check->solid == SOLID_NOT)
continue; // deactivated
if (check->absmin[0] > area_maxs[0]
|| check->absmin[1] > area_maxs[1]
|| check->absmin[2] > area_maxs[2]
|| check->absmax[0] < area_mins[0]
|| check->absmax[1] < area_mins[1]
|| check->absmax[2] < area_mins[2])
continue; // not touching

if (area_count == area_maxcount)
Com_Printf ("SV_AreaEdicts: MAXCOUNT\n");

area_list[area_count] = check;

The problem is that sometimes, somehow, the variables l, start, start->next, and l->next are NULL. I can't figure out why. The pointers should create a circular linked-list. Note: I did not write this code, or the code that builds the linked list. I think John Carmack wrote it.

It appears that the problem stems from some of my entities colliding with the worldspawn entity and with each other, but I don't have any idea why these collisions would create these bad pointer problems.

I have reverted back to the baseline Q2 engine source code; whatever it causing the problem is in my gamex86.dll code (probably?!)... but I have no idea where to look.

In my dream world, this plea for help spreads across the internet, and John Carmack emails me with a one-line code fix.



Email blogmasterofnoneATgmailDOTcom for text link and key word rates.

Site Info