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

Function osipf_SetPlayerControlMode

Descent3/osiris_predefs.cpp:3440–3453  ·  view source on GitHub ↗

turns the given player into AI mode or back to regular control mode

Source from the content-addressed store, hash-verified

3438
3439// turns the given player into AI mode or back to regular control mode
3440void osipf_SetPlayerControlMode(int pnum, bool set_to_ai) {
3441 ASSERT(pnum >= 0 && pnum < MAX_PLAYERS);
3442 if (pnum < 0 || pnum >= MAX_PLAYERS)
3443 return;
3444
3445 if (set_to_ai) {
3446 if (pnum != Player_num)
3447 return; // only change it for ourselves
3448
3449 PlayerSetControlToAI(pnum);
3450 } else {
3451 ResetPlayerControlType(pnum);
3452 }
3453}
3454
3455// gets information about a path point
3456// pass NULL for parameters not needed.

Callers 1

msafe_CallFunctionFunction · 0.85

Calls 2

PlayerSetControlToAIFunction · 0.85
ResetPlayerControlTypeFunction · 0.85

Tested by

no test coverage detected