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

Function MAI_Lazhelp

Source/monster.cpp:4383–4415  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4381}
4382
4383void MAI_Lazhelp(int i)
4384{
4385 int _mx, _my;
4386 volatile int md; // BUGFIX: very questionable volatile
4387 MonsterStruct *Monst;
4388
4389 if ((DWORD)i >= MAXMONSTERS)
4390 app_fatal("MAI_Lazhelp: Invalid monster %d", i);
4391 if (monster[i]._mmode != MM_STAND)
4392 return;
4393
4394 Monst = monster + i;
4395 _mx = Monst->_mx;
4396 _my = Monst->_my;
4397 md = M_GetDir(i);
4398
4399 if (dFlags[_mx][_my] & BFLAG_VISIBLE) {
4400 if (gbMaxPlayers == 1) {
4401 if (quests[QTYPE_VB]._qvar1 <= 5) {
4402 Monst->_mgoal = MGOAL_INQUIRING;
4403 } else {
4404 Monst->mtalkmsg = 0;
4405 Monst->_mgoal = MGOAL_NORMAL;
4406 }
4407 } else
4408 Monst->_mgoal = MGOAL_NORMAL;
4409 }
4410 if (Monst->_mgoal == MGOAL_NORMAL)
4411 MAI_Succ(i);
4412 Monst->_mdir = md;
4413 if (monster[i]._mmode == MM_STAND)
4414 Monst->_mAnimData = Monst->MType->Anims[MA_STAND].Data[md];
4415}
4416
4417void MAI_Lachdanan(int i)
4418{

Callers

nothing calls this directly

Calls 3

app_fatalFunction · 0.85
M_GetDirFunction · 0.85
MAI_SuccFunction · 0.85

Tested by

no test coverage detected