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

Function M_DoWalk3

Source/monster.cpp:1965–1998  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1963}
1964
1965BOOL M_DoWalk3(int i)
1966{
1967 BOOL rv;
1968
1969 if ((DWORD)i >= MAXMONSTERS)
1970 app_fatal("M_DoWalk3: Invalid monster %d", i);
1971 if (monster[i].MType == NULL)
1972 app_fatal("M_DoWalk3: Monster %d \"%s\" MType NULL", i, monster[i].mName);
1973
1974 if (monster[i]._mVar8 == monster[i].MType->Anims[MA_WALK].Frames) {
1975 dMonster[monster[i]._mx][monster[i]._my] = 0;
1976 monster[i]._mx = monster[i]._mVar1;
1977 monster[i]._my = monster[i]._mVar2;
1978 dFlags[monster[i]._mVar4][monster[i]._mVar5] &= ~BFLAG_MONSTLR;
1979 dMonster[monster[i]._mx][monster[i]._my] = i + 1;
1980 if (monster[i]._uniqtype)
1981 ChangeLightXY(monster[i].mlid, monster[i]._mx, monster[i]._my);
1982 M_StartStand(i, monster[i]._mdir);
1983 rv = TRUE;
1984 } else {
1985 if (!monster[i]._mAnimCnt) {
1986 monster[i]._mVar8++;
1987 monster[i]._mVar6 += monster[i]._mxvel;
1988 monster[i]._mVar7 += monster[i]._myvel;
1989 monster[i]._mxoff = monster[i]._mVar6 >> 4;
1990 monster[i]._myoff = monster[i]._mVar7 >> 4;
1991 }
1992 rv = FALSE;
1993 }
1994 if (monster[i]._uniqtype != 0)
1995 M_ChangeLightOffset(i);
1996
1997 return rv;
1998}
1999
2000void M_TryM2MHit(int i, int mid, int hper, int mind, int maxd)
2001{

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