- Code: Select all • Expand view
class CustomActor : Actor
{
override void PostBeginPlay()
{
super.PostBeginPlay();
players[consoleplayer].GetPSprite(0);
players[consoleplayer].GetPSprite(0);
players[consoleplayer].GetPSprite(0);
players[consoleplayer].GetPSprite(0);
players[consoleplayer].GetPSprite(0);
let psp = players[consoleplayer].psprites;
while (psp)
{
if (psp.id == 0)
{
console.printf("PSprite with id 0 exists");
if (!players[consoleplayer].FindPSprite(0))
console.printf("Cannot find layer 0 despite existing");
}
psp = psp.next;
}
}
}
Summon the actor via the console and this code will print 5 times. Tested on the latest GZDoom build (4.7.1).