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

Function cUpdateGravityRoomBoxStates

scripts/Merc3.cpp:1852–1871  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1850*/
1851
1852void cUpdateGravityRoomBoxStates(int gravity_room) {
1853 int i, handle;
1854
1855 for (i = 1; i < (N_BOXES + 1); i++) {
1856 char objname[64];
1857 int8_t cur_box_state = Gravity_room_box_states[gravity_room - 1][i - 1];
1858 if (cur_box_state == G_NONE) {
1859 snprintf(objname, sizeof(objname), "r%dBox%d", gravity_room, i);
1860 handle = Scrpt_FindObjectName(objname);
1861
1862 if (handle > OBJECT_HANDLE_NONE) {
1863 if (qObjAnimFrame(handle) == 15.0f || qObjAnimFrame(handle) == 20.0f) {
1864 // loop on middle animation.
1865 aObjPlayAnim(handle, Gravity_state_xlates[cur_box_state][G_NONE].first,
1866 Gravity_state_xlates[cur_box_state][G_NONE].last, 1.000000f, (cur_box_state == G_NONE) ? 1 : 0);
1867 }
1868 }
1869 }
1870 }
1871}
1872
1873/*
1874$$ENUM SharkTrapRoom

Callers 2

dsCustomRestoreFunction · 0.85
CallEventMethod · 0.85

Calls 2

qObjAnimFrameFunction · 0.85
aObjPlayAnimFunction · 0.85

Tested by

no test coverage detected