If you want to understand what that line does exactly, refer to the MSDN operators explanations: [OR assignment](https://msdn.microsoft.com/en-us/library/h5f1zzaw.aspx) and [Bitwise left-shift](https://msdn.microsoft.com/en-us/library/a1sway8w.aspx)
– Keyur PATELAug 25 '16 at 09:55
A byte is hex like 0xAB so you mask is doing a OR function 0xAB | 0x01. You code has |= which is equivalent to Mask = Mask | 1. You are shifting the mask by MapID so if MapID = 4, then 0x01 << 4 = 0x10
– jdwengAug 25 '16 at 09:57