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

Function PlayerIsShipAllowed

Descent3/Player.cpp:3690–3704  ·  view source on GitHub ↗

Returns true if the given ship is allowed to be chosen for a pnum

Source from the content-addressed store, hash-verified

3688
3689// Returns true if the given ship is allowed to be chosen for a pnum
3690bool PlayerIsShipAllowed(int pnum, char *ship_name) {
3691 ASSERT(ship_name);
3692
3693 if (pnum < -1 || pnum >= MAX_PLAYERS) // illegal value
3694 return false;
3695
3696 int ship_index = FindShipName(ship_name);
3697 if (ship_index == -1) {
3698 ASSERT(ship_index != -1);
3699 return false;
3700 }
3701 int bit = 0x01;
3702 bit = bit << ship_index;
3703 return ((Players[(pnum != -1) ? pnum : Player_num].ship_permissions & bit) != 0);
3704}
3705bool PlayerIsShipAllowed(int pnum, int ship_index) {
3706 if (pnum < -1 || pnum >= MAX_PLAYERS) // illegal value
3707 return false;

Callers 7

StartLevelFunction · 0.85
msafe_GetValueFunction · 0.85
MultiDoMyInfoFunction · 0.85
DoMultiAllowedFunction · 0.85
TCSSCollectInfoFunction · 0.85
MultiSaveSettingsFunction · 0.85
DoMissionBriefingFunction · 0.85

Calls 1

FindShipNameFunction · 0.85

Tested by

no test coverage detected