Bug in Decoration.skinnedFrag()

Discussions about Coding and Scripting
Post Reply
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Bug in Decoration.skinnedFrag()

Post by Barbie »

While reading the code of Decoration.skinnedFrag() I stumbled over the local variable Toucher:

Code: Select all

simulated function skinnedFrag(class<fragment> FragType, texture FragSkin, vector Momentum, float DSize, int NumFrags) 
{
	local int i;
	local actor A, Toucher;
	local Fragment s;

	if ( bOnlyTriggerable )
		return; 
	if (Event!='')
		foreach AllActors( class 'Actor', A, Event )
			A.Trigger( Toucher, pawn(Toucher) );
...
Toucher is never assigned before it is used and therefore always None - so all Actors with matching Tag to Decos Event receive an Event with parameters (none, none).
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Bug in Decoration.skinnedFrag()

Post by sektor2111 »

Hmm... yeah, to not mention that geniuses were in love with this Event because we have Event fired in Destroyed.
I'm thinking if by removing it something will get screwed, since... we are going to have Event a blink later, this is only loading another iterator for nothing...
nogardilaref
Masterful
Posts: 577
Joined: Tue Jun 20, 2017 1:00 pm
Personal rank: ⚋⚊⚌☰⚞⌖⚟☰⚌⚊⚋

Re: Bug in Decoration.skinnedFrag()

Post by nogardilaref »

Probably it was meant to be assigned something at the start, but was removed or never implemented and it was forgotten.
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Bug in Decoration.skinnedFrag()

Post by sektor2111 »

Yeah, but is not a big deal. At this moment I have a double fix. One goes to XC stuff replacing crap, the second goes right into Engine file conforming it properly. Done !
Post Reply