Skip to content

Instantly share code, notes, and snippets.

@chrisinajar
Last active December 23, 2015 01:09
Show Gist options
  • Save chrisinajar/6558718 to your computer and use it in GitHub Desktop.
Save chrisinajar/6558718 to your computer and use it in GitHub Desktop.
Radiant and Dire bitmaps
function getBitmaps() {
var direBitmap = 0,
radiBitmap = 0,
i, cl, hero;
for (i = 0; i < server.clients.length; ++i) {
cl = server.clients[i];
if (!cl) { continue; }
if (cl.netprops.m_iTeamNum === dota.TEAM_DIRE) {
direBitmap += (1 << cl.netprops.m_iPlayerID);
} else if (cl.netprops.m_iTeamNum === dota.TEAM_RADIANT) {
radiBitmap += (1 << cl.netprops.m_iPlayerID);
}
}
return {
radiant: radiBitmap,
dire: direBitmap
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment