GetHandleId

Parameters
h handle

Handle

comment

Returns the internal index of the given handle; returns 0 if h is null.

Example: GetHandleId(Player(0)) -> 1048584

note

Removing a game object does not automatically invalidate an allocated handle:

uf = CreateUnit(Player(0), FourCC("hfoo"), -30, 0, 90)
GetHandleId(uf) --> 1049016
RemoveUnit(uf)
GetHandleId(uf) --> 1049016
uf = nil
GetHandleId(uf) --> 0
note

Sometimes the handle ID may be different between clients.

note

The handle index returned here is only a weak and not a conclusive indicator of leaking game objects. In other words, the number may be high without an actual leak.

patch

1.24a

Source
common.j
return type
integer
Source code
native GetHandleId takes handle h returns integer