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

Function SpawnRock

Source/items.cpp:2357–2384  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2355}
2356
2357void SpawnRock()
2358{
2359 int i, ii;
2360 int xx, yy;
2361 int ostand;
2362
2363 ostand = FALSE;
2364 for (i = 0; i < nobjects && !ostand; i++) {
2365 ii = objectactive[i];
2366 ostand = object[ii]._otype == OBJ_STAND;
2367 }
2368 if (ostand) {
2369 i = itemavail[0];
2370 itemavail[0] = itemavail[127 - numitems - 1];
2371 itemactive[numitems] = i;
2372 xx = object[ii]._ox;
2373 yy = object[ii]._oy;
2374 item[i]._ix = xx;
2375 item[i]._iy = yy;
2376 dItem[xx][item[i]._iy] = i + 1;
2377 GetItemAttrs(i, IDI_ROCK, currlevel);
2378 SetupItem(i);
2379 item[i]._iSelFlag = 2;
2380 item[i]._iPostDraw = TRUE;
2381 item[i]._iAnimFrame = 11;
2382 numitems++;
2383 }
2384}
2385
2386void RespawnItem(int i, BOOL FlipFlag)
2387{

Callers 1

InitItemsFunction · 0.85

Calls 2

GetItemAttrsFunction · 0.85
SetupItemFunction · 0.85

Tested by

no test coverage detected