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

Function Osiris_CancelTimer

Descent3/OsirisLoadandBind.cpp:2482–2508  ·  view source on GitHub ↗

Osiris_CancelTimer Purpose: Cancels a timer that's in use, given its handle

Source from the content-addressed store, hash-verified

2480// Purpose:
2481// Cancels a timer that's in use, given its handle
2482void Osiris_CancelTimer(int handle) {
2483 int slot;
2484
2485 slot = GET_SLOT(handle);
2486
2487 if (slot < 0 || slot >= MAX_OSIRIS_TIMERS)
2488 return;
2489
2490 if (OsirisTimers[slot].handle != handle) // not the same timer
2491 return;
2492
2493 OsirisTimers[slot].flags &= ~OITF_USED;
2494
2495 tOSIRISEventInfo ei;
2496 ei.evt_timercancel.detonated = 0;
2497 ei.evt_timercancel.handle = handle;
2498
2499 if (OsirisTimers[slot].flags & OITF_TRIGGERTIMER) {
2500 Osiris_CallTriggerEvent(OsirisTimers[slot].trignum, EVT_TIMERCANCEL, &ei);
2501 } else if (OsirisTimers[slot].flags & OITF_LEVELTIMER) {
2502 Osiris_CallLevelEvent(EVT_TIMERCANCEL, &ei);
2503 } else {
2504 object *obj = ObjGet(OsirisTimers[slot].objhandle);
2505 if (obj)
2506 Osiris_CallEvent(obj, EVT_TIMERCANCEL, &ei);
2507 }
2508}
2509
2510// Osiris_GetTimerHandle
2511// Purpose:

Callers 1

Osiris_CancelTimerIDFunction · 0.85

Calls 5

Osiris_CallTriggerEventFunction · 0.85
Osiris_CallLevelEventFunction · 0.85
ObjGetFunction · 0.85
Osiris_CallEventFunction · 0.85
GET_SLOTFunction · 0.70

Tested by

no test coverage detected