Page MenuHomeFeedback Tracker

GarbageManager::GetLifetime() returns the wrong value
Closed, ResolvedPublic

Description

The GarbageManager contains this method

/*!
Returns the remaining lifetime of an instance or -1 if not inserted.
\return Remaining lifetime in seconds or -1 if none.
*/
proto external float GetLifetime(IEntity ent);

and based on the description and its probably intended functionality it should return the REMAINING lifetime.
So if an entity is inserted with 60 seconds of lifetime and the manager ticks at the default rate of 10 seconds this method should return 60, 50, 40, 30, 20, 10, and then its deleted.
However, currently, it always returns the original lifetime it was inserted with aka 60.

Even if this was by design so far GetLifetime should return the remaining time, and then a separate method like GetTotalLifetime should be added if you want to get the lifetime the item was inserted with at the beginning.

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
General

Event Timeline

Arkensor created this task.Aug 24 2022, 6:19 PM
Geez changed the task status from New to Confirmed Internally.Aug 25 2022, 2:47 PM
Arkensor added a subscriber: Geez.Oct 5 2022, 10:39 AM

@Geez fixed as of 0.9.6

Geez closed this task as Resolved.Oct 6 2022, 2:15 PM
Geez claimed this task.