Code: Show/Hide pd->Lock();
FOR_EACH_PLAYER_P(temp, zData, playerKey) { if (temp->p_freq == 0) LLAdd(&humanList, temp); if (temp->p_freq == 1) LLAdd(&zombieList, temp); } pd->Unlock(); |
Code: Show/Hide Player *p;
Link *link; Target t; t.type = T_PLAYER; pd->Lock(); FOR_EACH_PLAYER(p) { t.u.p = p; game->WarpTo(&t,512,512); } pd->Unlock(); |
Code: Show/Hide Target tgt;
tgt.type = T_FREQ; tgt.u.freq.arena = arena; tgt.u.freq = 0; game->WarpTo(&tgt, x, y); tgt.u.freq = 1; game->WarpTo(&tgt, x, y); |
Code: Show/Hide Target human_tgt, zombie_tgt;
human_tgt.type = T_LIST; zombie_tgt.type = T_LIST; // bad/lazy way memcpy(&human_tgt.u.list, &humanList, sizeof(LinkedList)); memcpy(&zombie_tgt.u.list, &zombieList, sizeof(LinkedList)); ... // better way LLInit(&human_tgt.u.list); LLInit(&zombie_tgt.u.list); pd->Lock(); FOR_EACH_PLAYER_P(temp, zData, playerKey) { if (temp->p_freq == 0) LLAdd(&human_tgt.u.list, temp); if (temp->p_freq == 1) LLAdd(&zombie_tgt.u.list, temp); } pd->Unlock(); |
Code: Show/Hide Player *tempPlayer;
Link *link; Target t; t.type = T_PLAYER; pd->Lock(); FOR_EACH_PLAYER_P(tempPlayer, zData, playerKey) { zData->died = FALSE; if (tempPlayer->p_freq == 0) { t.u.p = tempPlayer; game->WarpTo (&t, eData->humanSpawnX, eData->humanSpawnY); } else if (tempPlayer->p_freq == 1) { t.u.p = tempPlayer; game->WarpTo (&t, eData->zombieSpawnX, eData->zombieSpawnY); } } pd->Unlock(); |