.qc (dot qc) - the group for quake c coders of all denominations. If you make quake one mods and write code in quake c, join our group! I'll try to answer any quake c questions - please post your inquiry in the forums...

  • View media
  • View media
  • View media
  • View media
  • View media
  • View media
Add media Report RSS Quake c - gone bad #C (view original)
Quake c - gone bad #C
embed
share
view previous next
Share Image
Share on Facebook Post Email a friend
Embed Image
Post comment Comments
numbersix Author
numbersix - - 2,244 comments

Server crashes with no free edicts - that is 32767 entities allocated.
This has happened 2 times. I have a sneaky suspicion something is amiss in tbaby_mitosis.
Some kind of race condition that allocates every free entity.
Will report back with the fix.

Reply Good karma+1 vote
numbersix Author
numbersix - - 2,244 comments

When you are debugging your own code -
(Or even better when writing it)
watch out for this...

ldmg = random() * 6;
while (ldmg > 0)
{
tbaby_mitosis(ldmg);
item_eject(newmis, GEN_BOUNCE);
}

Doh!
Seems I forgot to decrement ldmg in the loop. So the loop runs forever ejecting bits and making more blobs. Until there are no ents left.

Since it only happens in this case:
if (self.spawnflags & TB_SUPER)
if (random() < 0.2) // baby blast!

It doesnt occur very often, only 20% chance on a super tarbaby death.
Well, fixed like this:

while (ldmg > 0)
{
tbaby_mitosis(ldmg);
item_eject(newmis, GEN_BOUNCE);
ldmg = ldmg - 1; // fix loop error
}

Reply Good karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account:

Description

The eponymous crash report...