While reverse engineering a game using the Hex Rays decompiler I was looking for how an array of NPC's was accessed. I found the array but I don't quite understand the unusual formula for getting the index of the NPC. First an integer is
0xFFF then the result is multiplied by 4 to get the index.
dword_1F4A8A5C[4 * (v3 & 0xFFF)]
I'm really not sure if this is standard or if it's weird output from the Hex Rays decompiler. If anyone has an explanation please let me know. Thanks.