[3.1.0] Crash when action function relies on default vector2

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
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

[3.1.0] Crash when action function relies on default vector2

Post by Matt »

Also tried on 2ff492d.

To replicate, give this and fire:

Code: Select all

class badpistol:pistol{
	action void a_crashthis(vector2 crashing=(0,0)){
		A_Log("This will not appear");
		crashing+=vel.xy;
	}
	states{
	fire:
		PISG A 0 a_crashthis();
		goto super::fire;
	}
}
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: [3.1.0] Crash when action function relies on default vec

Post by _mental_ »

When at least one vector2 or vector3 parameter with default value is present all defaults are ignored including implicit arguments for action functions.
I think that this line needs to be moved here. Although all code generation stuff is like a minefield to me and I need Graf's approval of this.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [3.1.0] Crash when action function relies on default vec

Post by Graf Zahl »

I think you are correct. The vector code here was added later, after the rest was already working.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: [3.1.0] Crash when action function relies on default vec

Post by _mental_ »

OK, fixed in eda55b2.
Post Reply

Return to “Closed Bugs [GZDoom]”