diff --git a/Source/monster.cpp b/Source/monster.cpp index 5b2afde74..bc20f2060 100644 --- a/Source/monster.cpp +++ b/Source/monster.cpp @@ -1266,6 +1266,40 @@ int AddMonster(int x, int y, int dir, int mtype, BOOL InMap) return -1; } +#ifdef HELLFIRE +void monster_43C785(int i) +{ + int x, y, d, j, oi, dir, mx, my; + + if (monster[i].MType) { + mx = monster[i]._mx; + my = monster[i]._my; + dir = monster[i]._mdir; + for (d = 0; d < 8; d++) { + x = mx + offset_x[d]; + y = my + offset_y[d]; + if (!SolidLoc(x, y)) { + if (!dPlayer[x][y] && !dMonster[x][y]) { + if (!dObject[x][y]) + break; + oi = dObject[x][y] > 0 ? dObject[x][y] - 1 : -(dObject[x][y] + 1); + if (!object[oi]._oSolidFlag) + break; + } + } + } + if (d < 8) { + for (j = 0; j < MAX_LVLMTYPES; j++) { + if (Monsters[j].mtype == monster[i].MType->mtype) + break; + } + if (j < MAX_LVLMTYPES) + AddMonster(x, y, dir, j, TRUE); + } + } +} +#endif + void NewMonsterAnim(int i, AnimStruct &anim, int md) { MonsterStruct *Monst = monster + i; diff --git a/Source/monster.h b/Source/monster.h index 2d28c0f82..b1080b6a8 100644 --- a/Source/monster.h +++ b/Source/monster.h @@ -40,6 +40,9 @@ void PlaceUniques(); void SetMapMonsters(BYTE *pMap, int startx, int starty); void DeleteMonster(int i); int AddMonster(int x, int y, int dir, int mtype, BOOL InMap); +#ifdef HELLFIRE +void monster_43C785(int i); +#endif void NewMonsterAnim(int i, AnimStruct &anim, int md); BOOL M_Ranged(int i); BOOL M_Talker(int i);