by Matt » Sun Aug 13, 2017 10:00 am
Test code:
Code: Select all
class Invticker:Inventory{
default{
inventory.maxamount 100;
}
override void DoEffect(){
// override void Tick(){super.Tick();
if(amount>0){
amount--;
}
}
}
class Invgetter:Demon{
states{
melee:
SARG EF 8 A_SetTics(random(7,9));
SARG G 10{
int b=target.countinv("Invticker");
A_LogInt(b);
for(int i=0;i<b;i+=10){
spawn("Blood",pos+(random(-1,1),random(-1,1),50));
}
}goto see;
}
}
Start a netgame, summon an Invgetter, give yourself 100 Invticker and let the Invgetter chew on you. The numbers logged will be different for each player.
If I replace DoEffect() with Tick() (as shown in the commented-out line), it's fine.
I suspect it's related to why
an RNG call would also cause problems (and why I couldn't replicate it in vanilla - the isolated example didn't have anything that another actor would depend on for anything affecting the playsim).
Test code:[code=php]
class Invticker:Inventory{
default{
inventory.maxamount 100;
}
override void DoEffect(){
// override void Tick(){super.Tick();
if(amount>0){
amount--;
}
}
}
class Invgetter:Demon{
states{
melee:
SARG EF 8 A_SetTics(random(7,9));
SARG G 10{
int b=target.countinv("Invticker");
A_LogInt(b);
for(int i=0;i<b;i+=10){
spawn("Blood",pos+(random(-1,1),random(-1,1),50));
}
}goto see;
}
} [/code]Start a netgame, summon an Invgetter, give yourself 100 Invticker and let the Invgetter chew on you. The numbers logged will be different for each player.
If I replace DoEffect() with Tick() (as shown in the commented-out line), it's fine.
I suspect it's related to why [url=https://forum.zdoom.org/viewtopic.php?p=1014025#p1014025]an RNG call would also cause problems[/url] (and why I couldn't replicate it in vanilla - the isolated example didn't have anything that another actor would depend on for anything affecting the playsim).