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

Function TelComEnableSystemKey

Descent3/TelCom.cpp:2440–2456  ·  view source on GitHub ↗

* Enables/Disables a TelCom system key, pass in TCSYS_MAXKEYS to enable/disable all keys * */

Source from the content-addressed store, hash-verified

2438 *
2439 */
2440void TelComEnableSystemKey(int key, bool enable) {
2441 if (key < 0 || key > TCSYS_MAXKEYS)
2442 return;
2443
2444 int bit = 0x01;
2445
2446 if (key == TCSYS_MAXKEYS) {
2447 bit = 0xFFFFFFFF;
2448 } else {
2449 bit = (bit << key);
2450 }
2451
2452 if (enable)
2453 Telcom_system.TelComSysKeyEnable |= bit;
2454 else
2455 Telcom_system.TelComSysKeyEnable &= ~bit;
2456}
2457
2458/*
2459 * Calling this sends an event message to the TelCom, adding it to it's event queue

Callers 2

TelComMainFunction · 0.85
TelComAutoMapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected