MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / ChangeRankIndex

Function ChangeRankIndex

Descent3/multi_server.cpp:2985–3002  ·  view source on GitHub ↗

Does PXO stuff and sends out messages demoting/promoting the player

Source from the content-addressed store, hash-verified

2983
2984// Does PXO stuff and sends out messages demoting/promoting the player
2985void ChangeRankIndex(int old_index, int pnum) {
2986 char str[255];
2987 int new_index = GetRankIndex(pnum);
2988 uint8_t goodnews = 1;
2989
2990 if (old_index < new_index) // promoted
2991 {
2992 snprintf(str, sizeof(str), "%s %s %s %s!", Players[pnum].callsign, TXT_HAS_BEEN, TXT_PROMOTED,
2993 TXT(TXT_MULTI_RANKS + new_index));
2994 goodnews = 1;
2995 } else {
2996 snprintf(str, sizeof(str), "%s %s %s %s!", Players[pnum].callsign, TXT_HAS_BEEN, TXT_DEMOTED,
2997 TXT(TXT_MULTI_RANKS + new_index));
2998 goodnews = 0;
2999 }
3000
3001 MultiSendChangeRank(pnum, str, goodnews);
3002}
3003
3004// Given a killer and killed player, calculates their new rankings
3005void GetNewRankings(object *killed, object *killer) {

Callers 2

ProcessTestKeysFunction · 0.85
GetNewRankingsFunction · 0.85

Calls 2

GetRankIndexFunction · 0.85
MultiSendChangeRankFunction · 0.85

Tested by

no test coverage detected