pVars

Pointer to the start of the memory area occupied by global lite-C variables. Any global lite-C variable or struct can be identified by the distance of its address to this pointer, even in different instances of the application, in multiplayer games or in saved games where all pointers can be different. This way the pVars pointer can be used to create a unique handle for any variable or struct that is, unlike a pointer, the same in all application instances.

Type:

void*

Remarks

Edition

A7.08 LC

Example:

long var_to_handle(void* address)
{
   return (long)address - (long)pVars;
}

void* var_for_handle(long handle)
{
  return (void*)(handle + (long)pVars);
}

See also:

handle, send_var

► latest version online