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

Function M_DoWalk

Source/monster.cpp:1901–1932  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1899}
1900
1901BOOL M_DoWalk(int i)
1902{
1903 BOOL rv;
1904
1905 if ((DWORD)i >= MAXMONSTERS)
1906 app_fatal("M_DoWalk: Invalid monster %d", i);
1907 if (monster[i].MType == NULL)
1908 app_fatal("M_DoWalk: Monster %d \"%s\" MType NULL", i, monster[i].mName);
1909
1910 rv = FALSE;
1911 if (monster[i]._mVar8 == monster[i].MType->Anims[MA_WALK].Frames) {
1912 dMonster[monster[i]._mx][monster[i]._my] = 0;
1913 monster[i]._mx += monster[i]._mVar1;
1914 monster[i]._my += monster[i]._mVar2;
1915 dMonster[monster[i]._mx][monster[i]._my] = i + 1;
1916 if (monster[i]._uniqtype != 0)
1917 ChangeLightXY(monster[i].mlid, monster[i]._mx, monster[i]._my);
1918 M_StartStand(i, monster[i]._mdir);
1919 rv = TRUE;
1920 } else if (!monster[i]._mAnimCnt) {
1921 monster[i]._mVar8++;
1922 monster[i]._mVar6 += monster[i]._mxvel;
1923 monster[i]._mVar7 += monster[i]._myvel;
1924 monster[i]._mxoff = monster[i]._mVar6 >> 4;
1925 monster[i]._myoff = monster[i]._mVar7 >> 4;
1926 }
1927
1928 if (monster[i]._uniqtype != 0)
1929 M_ChangeLightOffset(i);
1930
1931 return rv;
1932}
1933
1934BOOL M_DoWalk2(int i)
1935{

Callers 1

ProcessMonstersFunction · 0.85

Calls 4

app_fatalFunction · 0.85
ChangeLightXYFunction · 0.85
M_StartStandFunction · 0.85
M_ChangeLightOffsetFunction · 0.85

Tested by

no test coverage detected