Total Members Voted: 28
i think it is funny, and consider that situation everytime i jump over a spawn pad. In the end, its just a silly game, and i personally dont get too hung up over the score. Unless someone is winning, then that is f***ing bullshit man!
Quote from: [BTF]Gator on May 22, 2007, 06:19:03 PMi think it is funny, and consider that situation everytime i jump over a spawn pad.
i think it is funny, and consider that situation everytime i jump over a spawn pad.
edict_t *SelectRandomDeathmatchSpawnPoint (void){ // avoid spawn pads where the client is closer than LIKELY_TELEFRAG_DIST const int LIKELY_TELEFRAG_DIST = 128; const int MAX_SPAWN_POINTS = 256; edict_t *preferred_spots[MAX_SPAWN_POINTS]; edict_t *all_spots[MAX_SPAWN_POINTS]; int preferred_count = 0; int all_count = 0; edict_t *spot = NULL; float range; while ((spot = G_Find (spot, FOFS(classname), "info_player_deathmatch")) != NULL) { range = PlayersRangeFromSpot(spot); if (range > LIKELY_TELEFRAG_DIST) { if (preferred_count < MAX_SPAWN_POINTS) { preferred_spots[preferred_count] = spot; ++preferred_count; } } if (all_count < MAX_SPAWN_POINTS) { all_spots[all_count] = spot; ++all_count; } } spot = NULL; // we'll return NULL if no spawn points at ALL could be found { edict_t **spots; int spots_count; if (preferred_count > 0) { spots = preferred_spots; spots_count = preferred_count; } else { spots = all_spots; spots_count = all_count; } if (spots_count > 0) { // Having read an article about how the lower bits of rand() on // many systems' stlib aren't very random, we'll try to mix it // up a bit here. (hopefully in some meaningful way) int selection; unsigned short rndval; rndval = rand(); rndval = (rndval >> 8) | ((rndval & 0xff) << 8); rndval ^= rand(); // hopefully this isn't stupid :) selection = rndval % spots_count; spot = spots[selection]; } } return spot;}