From cf81adbd475c11fae7861366e00fb25e3319b8a2 Mon Sep 17 00:00:00 2001 From: Dennis Duda Date: Wed, 29 Aug 2018 01:09:24 +0200 Subject: [PATCH] Minor adjustments to `InitLevelMonsters` and `AddMonsterType` --- Source/monster.cpp | 7 ++++++- structs.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/monster.cpp b/Source/monster.cpp index bf58ff7bb..94eed8176 100644 --- a/Source/monster.cpp +++ b/Source/monster.cpp @@ -396,14 +396,18 @@ void __cdecl InitLevelMonsters() MissileFileFlag = 0; for ( i = 0; i < MAX_LVLMTYPES; i++ ) + { Monsters[i].mPlaceFlags = 0; + } ClrAllMonsters(); nummonsters = 0; totalmonsters = MAXMONSTERS; for ( i = 0; i < MAXMONSTERS; i++ ) + { monstactive[i] = i; + } uniquetrans = 0; } @@ -422,7 +426,8 @@ int __fastcall AddMonsterType(int type, int placeflag) if ( !done ) { - i = nummtypes++; + i = nummtypes; + nummtypes++; Monsters[i].mtype = type; monstimgtot += monsterdata[type].mType; InitMonsterGFX(i); diff --git a/structs.h b/structs.h index eadcbe8bf..81779311d 100644 --- a/structs.h +++ b/structs.h @@ -495,6 +495,7 @@ struct AnimStruct // note: wrong names struct CMonster { unsigned char mtype; + // TODO: Add enum for place flags unsigned char mPlaceFlags; AnimStruct Anims[6]; TSnd *Snds[8];