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

Function M_ChangeLightOffset

Source/monster.cpp:1849–1876  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1847}
1848
1849void M_ChangeLightOffset(int monst)
1850{
1851 int lx, ly, _mxoff, _myoff, sign;
1852
1853 if ((DWORD)monst >= MAXMONSTERS)
1854 app_fatal("M_ChangeLightOffset: Invalid monster %d", monst);
1855
1856 lx = monster[monst]._mxoff + 2 * monster[monst]._myoff;
1857 ly = 2 * monster[monst]._myoff - monster[monst]._mxoff;
1858
1859 if (lx < 0) {
1860 sign = -1;
1861 lx = -lx;
1862 } else {
1863 sign = 1;
1864 }
1865
1866 _mxoff = sign * (lx >> 3);
1867 if (ly < 0) {
1868 _myoff = -1;
1869 ly = -ly;
1870 } else {
1871 _myoff = 1;
1872 }
1873
1874 _myoff *= (ly >> 3);
1875 ChangeLightOff(monster[monst].mlid, _mxoff, _myoff);
1876}
1877
1878BOOL M_DoStand(int i)
1879{

Callers 3

M_DoWalkFunction · 0.85
M_DoWalk2Function · 0.85
M_DoWalk3Function · 0.85

Calls 2

app_fatalFunction · 0.85
ChangeLightOffFunction · 0.85

Tested by

no test coverage detected