- In release builds, the first time this function is called within any method body, the return value is always infinity.
- In debug builds, every call appears to return infinity before some significant amount of time has passed.
The following example demonstrates the buggy behavior in GZDoom 4.8.0 (official release build):
Code: Select all
class TestInv : Inventory
{
override void Tick()
{
Super.Tick();
Test();
Console.Printf("---");
Test();
Console.Printf("---");
}
private void Test()
{
Console.Printf("%d: %f", GetAge(), System.GetTimeFrac());
Console.Printf("%d: %f", GetAge(), System.GetTimeFrac());
}
}
Code: Select all
10: inf
10: 0.000000
---
10: inf
10: 0.000000
---
11: inf
11: 0.000000
---
11: inf
11: 0.000000
...
Code: Select all
class TestInv : Inventory
{
override void Tick()
{
Super.Tick();
Console.Printf("%d: %f", GetAge(), System.GetTimeFrac());
Console.Printf("%d: %f", GetAge(), System.GetTimeFrac());
if (Owner != null)
{
let it = BlockThingsIterator.Create(Owner, 1024);
int cnt = 0;
while (it.Next())
{
cnt++;
}
Console.Printf("%d: %f (%d)", GetAge(), System.GetTimeFrac(), cnt);
}
Console.Printf("---");
}
}
Code: Select all
10: inf
10: inf
10: 0.342887 (29)
---
11: inf
11: inf
11: 0.400922 (29)
---
...