Duke4.net Forums: Laserline crash bug - Duke4.net Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Laserline crash bug

User is offline   Danukem 

  • Duke Plus Developer

#1

I just had a crash caused by the game attempting to make an infinitely long chain of laserline sprites (too many sprites spawned). When the tripbomb "woke up" and the laserlines spawned, they continued right through white walls and kept going. This is in a map that has been played many times before with no problems (Demolition Plant, by Henry K). I was using my Attrition mod at the time, but I have checked my code and it doesn't mess with laserlines at all or do anything else that would seem to explain what happened. I have attached the debug.map and the debug.log (in the log you can see that about 14000 laserlines were spawned until it crashed). I have also attached a couple of screenshots in mapster showing the sprites.

EDIT: I also have a saved game that reliably causes the crash when the player walks forward and looks into the room with the tripbombs. I will go ahead and attach that as well, but be warned that it uses a version of Attrition that is not uploaded anywhere.

Attached thumbnail(s)

  • Attached Image: capt0000.png
  • Attached Image: capt0001.png

Attached File(s)


0

User is offline   Danukem 

  • Duke Plus Developer

#2

UPDATE: The crash only happens when the map is mirrored. I had some code that was making some tripbombs face the wrong direction in the mirrored map, and apparently that was making it crash. I still hope the bug will be fixed (tripbombs facing the wrong way should not make infinite laser lines!) but at least I can avoid it now.
0

User is offline   Hendricks266 

  • Weaponized Autism

  #3

View PostDeeperThought, on 07 October 2011 - 10:05 AM, said:

tripbombs facing the wrong way should not make infinite laser lines!

I'll look into it.
0

User is offline   Danukem 

  • Duke Plus Developer

#4

View PostHendricks266, on 07 October 2011 - 03:54 PM, said:

I'll look into it.


This code in actors.c seems to be what spawns LASERLINE:

 	x = A_CheckHitSprite(i,&m);
 	
 	actor[i].lastvx = x;
 	
 	s->ang = l;
 	
 	k = 0;
 	
 	// if(lTripBombControl & TRIPBOMB_TRIPWIRE)
 	if (actor[i].t_data[6] != 1)
 	{
	 	// we're on a trip wire 	
	 	while (x > 0)
	 	{
		 	j = A_Spawn(i,LASERLINE);
		 	setsprite(j,(vec3_t *)&sprite[j]);
		 	sprite[j].hitag = s->hitag;
		 	actor[j].t_data[1] = sprite[j].z;
		 	
		 	s->x += sintable[(T6+512)&2047]>>4;
		 	s->y += sintable[(T6)&2047]>>4;
		 	
		 	if (x < 1024)
		 	{
			 	sprite[j].xrepeat = x>>5;
			 	break;
		 	}
		 	x -= 1024;
		}
 	}


Apparently it spawns one LASERLINE for every 1024 units of x. So x is being set to the wrong value before the spawning loop, which means there might be a problem in A_CheckHitSprite(). What's interesting is that there is no check for nullspace or anything else once it gets down into the spawning loop (although there might be some checks built into the A_Spawn function).
0

User is offline   Hendricks266 

  • Weaponized Autism

  #5

r2072:

Quote

Tripbombs now stop producing laserlines when they reach invalid space. In effect, tripbombs facing the wrong way will not make infinite laser lines.

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options