Open SeriousBarbie opened 3 years ago
Reproduce:
Expected result: SpecialEvent1 fired. Actual result: SpecialEvent1 not fired.
function Tick(float DeltaTime)
{
local int NewFatness;
if ( !bFading )
{
NewFatness = fatness + 50 * DeltaTime;
bFading = ( NewFatness > 160 );
}
else if ( Style == STY_Translucent )
{
ScaleGlow -= 3 * DeltaTime;
if ( ScaleGlow < 0.3 )
{
PlaySound(sound'Teleport1',, 2.0);
Destroy();
change to
function Tick(float DeltaTime)
{
local int NewFatness;
local actor A;
if ( !bFading )
{
NewFatness = fatness + 50 * DeltaTime;
bFading = ( NewFatness > 160 );
}
else if ( Style == STY_Translucent )
{
ScaleGlow -= 3 * DeltaTime;
if ( ScaleGlow < 0.3 )
{
PlaySound(sound'Teleport1',, 2.0);
if( Event != '' )
foreach AllActors( class 'Actor', A, Event )
A.Trigger( self, self );
Destroy();
Better remove event after it has been risen to avoid double rising caused by other existing fixes.
class NaliSB extends Nali;
...
event Destroyed() {
local Actor A;
if (IsInState('FadeOut'))
if (Event != '')
foreach AllActors(Class'Actor', A, Event)
A.Trigger(Self, Self);
}
Not sure about that. Some code can be written in assumption Event not changed. For example used custom nali which do some stuff in Destroyed(). Like your code. Why need nullify Event for make compatible with your code but not leave Event same as some other code assume?
When a Nali is in state "FadeOut" it simply gets destroyed and therefore does not raise its event: https://github.com/Slipyx/UT99/blob/master/UnrealShare/Nali.uc#L907
Bug exists in all versions AFAIK.