Page 1 of 1

[3.1.0] Crash when action function relies on default vector2

Posted: Fri Jun 16, 2017 1:48 am
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;
	}
}

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

Posted: Fri Jun 16, 2017 2:43 am
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.

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

Posted: Fri Jun 16, 2017 2:49 am
by Graf Zahl
I think you are correct. The vector code here was added later, after the rest was already working.

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

Posted: Fri Jun 16, 2017 3:00 am
by _mental_
OK, fixed in eda55b2.