[floatcvt]A_CheckLOF not working

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
Major Cooke
Posts: 8209
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

[floatcvt]A_CheckLOF not working

Post by Major Cooke »

EDIT: Fixed code.

Code: Select all

Actor ST
{
	+NOINTERACTION
	States
	{Actor ST
{
	+NOINTERACTION
	States
	{
	Spawn:
		PLAY A 35 
		PLAY A 0
		{
			A_RearrangePointers(AAPTR_PLAYER1,AAPTR_DEFAULT,AAPTR_DEFAULT,4);
			if (A_CheckLOF("Null",CLOFF_FROMBASE,32767,0,0,0,40))
			{	A_Log("Success");	}
			else
			{	A_Log("Failure");	}
		}
		Stop
	}
}
This always fails. Summon ST in console. It should succeed if nothing's in the way, but it doesn't.
Last edited by Major Cooke on Sun Mar 27, 2016 7:28 am, edited 1 time in total.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [floatcvt]A_CheckLOF not working

Post by Graf Zahl »

To be honest, I have no idea what you are expecting here.

First, this is missnig the CLOFF_ALLOWNULL flag, making it always fail by default and second, it contains absolutely no instructions what to do with a found target so it runs through with the BadActor flag being set and the target being ignored, even if the player is in the line of fire.

I'd say 'works as intended' here.
User avatar
Major Cooke
Posts: 8209
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

Re: [floatcvt]A_CheckLOF not working

Post by Major Cooke »

Whoops, copied the old code instead of the new when I pasted. I simply forgot an A_RearrangePointers.

Corrected code:

Code: Select all

Actor ST
{
	+NOINTERACTION
	States
	{
	Spawn:
		PLAY A 35 
		PLAY A 0
		{
			A_RearrangePointers(AAPTR_PLAYER1,AAPTR_DEFAULT,AAPTR_DEFAULT,4);
			if (A_CheckLOF("Null",CLOFF_FROMBASE,32767,0,0,0,40))
			{	A_Log("Success");	}
			else
			{	A_Log("Failure");	}
		}
		Stop
	}
}
User avatar
Major Cooke
Posts: 8209
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

Re: [floatcvt]A_CheckLOF not working

Post by Major Cooke »

So did this one check out better?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [floatcvt]A_CheckLOF not working

Post by Graf Zahl »

I haven't checked yet - too busy with other stuff.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [floatcvt]A_CheckLOF not working

Post by Graf Zahl »

This is still not a bug in A_CheckLOF. A_RearrangePointers cannot do what you ask. It only can switch around target, tracer and master, nothing else.
User avatar
Major Cooke
Posts: 8209
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

Re: [floatcvt]A_CheckLOF not working

Post by Major Cooke »

Okay, I found an example. This only works if the zombie's up close.

Code: Select all

Actor ST : Zombieman
{
	States
	{
	See:
		POSS A 0
		{
			if (A_CheckLOF("Null",CLOFF_SKIPOBSTACLES|CLOFF_FROMBASE,32767,0,0,0,40))
			{	A_Log("Success");	}
			else
			{	A_Log("Failure");	}
		}
		POSS AABBCCDD 4 A_Chase("","")
		Loop
	}
}
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [floatcvt]A_CheckLOF not working

Post by Graf Zahl »

That's the sight check bug in play.
Should be fixed.
User avatar
Major Cooke
Posts: 8209
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

Re: [floatcvt]A_CheckLOF not working

Post by Major Cooke »

Nope, it's not. Trying to figure out what's causing it...
User avatar
Major Cooke
Posts: 8209
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

Re: [floatcvt]A_CheckLOF not working

Post by Major Cooke »

Tested again after the re-merge, still persistent.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [floatcvt]A_CheckLOF not working

Post by Graf Zahl »

Ok, found it.

But while I was debugging this I found something interesting:

Any sight check or trace that spans more than 100 blockmap blocks or more will fail, due to the infamous "for (count = 0 ; count < 100 ; count++)" loop in there that was added to catch lost traces due to the corner bug in the function. This will have to be increased and the checks made more robust so that it can handle such things.
User avatar
Major Cooke
Posts: 8209
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

Re: [floatcvt]A_CheckLOF not working

Post by Major Cooke »

So technically, is the max distance limit 6400 currently?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [floatcvt]A_CheckLOF not working

Post by Graf Zahl »

No. One block is 128 map units - and I just fixed that.
Post Reply

Return to “Closed Bugs [GZDoom]”