MCPcopy Create free account
hub / github.com/diasurgical/devilution / OperateLever

Function OperateLever

Source/objects.cpp:2360–2386  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2358}
2359
2360void OperateLever(int pnum, int i)
2361{
2362 int j, oi;
2363 BOOL mapflag;
2364
2365 if (object[i]._oSelFlag != 0) {
2366 if (!deltaload)
2367 PlaySfxLoc(IS_LEVER, object[i]._ox, object[i]._oy);
2368 object[i]._oSelFlag = 0;
2369 object[i]._oAnimFrame++;
2370 mapflag = TRUE;
2371 if (currlevel == 16) {
2372 for (j = 0; j < nobjects; j++) {
2373 oi = objectactive[j];
2374 if (object[oi]._otype == OBJ_SWITCHSKL
2375 && object[i]._oVar8 == object[oi]._oVar8
2376 && object[oi]._oSelFlag != 0) {
2377 mapflag = FALSE;
2378 }
2379 }
2380 }
2381 if (mapflag)
2382 ObjChangeMap(object[i]._oVar1, object[i]._oVar2, object[i]._oVar3, object[i]._oVar4);
2383 if (pnum == myplr)
2384 NetSendCmdParam1(FALSE, CMD_OPERATEOBJ, i);
2385 }
2386}
2387
2388void OperateBook(int pnum, int i)
2389{

Callers 2

OperateObjectFunction · 0.85
SyncOpObjectFunction · 0.85

Calls 3

PlaySfxLocFunction · 0.85
ObjChangeMapFunction · 0.85
NetSendCmdParam1Function · 0.85

Tested by

no test coverage detected