//Fixed: accept signed int in id parameter
//Fixed: buckets aren't initialized at Sim::init time, so return 0
ADDR FIXEDtsf_FindObject(int id)
{
	ADDR bucket_addr = *(ADDR *)(tsf_gIdDictionary) + 4*(id & 0xFFF);
	if(bucket_addr == 0)
		return 0;

	ADDR obj = *(ADDR *)bucket_addr;

	if(!obj)
		return 0;

	while(obj && *(int*)(obj + 32) != id)
	{
		obj = *(ADDR *)(obj + 16);
		if(!obj)
			return 0;
	}

	return obj;
}

