Excuse me, let me simplify. Consider this code:
Code: Select all
class SwitchedMaster : actor
{
default
{
//$Arg0 Child TID
//$Arg0Type 14
+Dormant;
}
override void deactivate(actor activator)
{
console.printf("["..level.time.."]["..GetCharacterName().."] Deactivated by "..(activator ? activator.GetCharacterName() : "[NULL]"));
Level.ExecuteSpecial(131, activator, null, false, args[0], 0, 0, 0, 0);
}
}
class SwitchedChild : actor
{
override void deactivate(actor activator)
{
console.printf("["..level.time.."]["..GetCharacterName().."] Deactivated by "..(activator ? activator.GetCharacterName() : "[NULL]"));
}
}
Create a new map, with player 1 start
Place a child, set TID 1
Place a master, set arg0 1
Place another child, set TID 1
run the map
master is dormant, so the deactivate fires immediately, tic 0
special "deactivate thing" is called for TID 1
One child reports deactivation
The other child never does
I believe because the master deactivation was fired before the second child was loaded in the map.
Therefore my conslusion is that the dormant deactivation is called from BeginPlay instead of PostBeginPlay
My suggestion is to move it into PostBeginPlay
Excuse me, let me simplify. Consider this code:
[code]
class SwitchedMaster : actor
{
default
{
//$Arg0 Child TID
//$Arg0Type 14
+Dormant;
}
override void deactivate(actor activator)
{
console.printf("["..level.time.."]["..GetCharacterName().."] Deactivated by "..(activator ? activator.GetCharacterName() : "[NULL]"));
Level.ExecuteSpecial(131, activator, null, false, args[0], 0, 0, 0, 0);
}
}
class SwitchedChild : actor
{
override void deactivate(actor activator)
{
console.printf("["..level.time.."]["..GetCharacterName().."] Deactivated by "..(activator ? activator.GetCharacterName() : "[NULL]"));
}
}
[/code]
Create a new map, with player 1 start
Place a child, set TID 1
Place a master, set arg0 1
Place another child, set TID 1
run the map
master is dormant, so the deactivate fires immediately, tic 0
special "deactivate thing" is called for TID 1
One child reports deactivation
The other child never does
I believe because the master deactivation was fired before the second child was loaded in the map.
Therefore my conslusion is that the dormant deactivation is called from BeginPlay instead of PostBeginPlay
My suggestion is to move it into PostBeginPlay