From d78ffef5fa27801e39b9f1577bb44d436aea3696 Mon Sep 17 00:00:00 2001 From: Dennis Duda Date: Sun, 5 Aug 2018 21:08:18 +0200 Subject: [PATCH] Cleaned up `InitLevelMonsters` and `AddMonsterType` --- Source/monster.cpp | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/Source/monster.cpp b/Source/monster.cpp index edabc1a73..ab08c33fb 100644 --- a/Source/monster.cpp +++ b/Source/monster.cpp @@ -388,7 +388,7 @@ void __fastcall InitMonsterTRN(int monst, BOOL special) void __cdecl InitLevelMonsters() { - int i; // eax + int i; nummtypes = 0; monstimgtot = 0; @@ -406,23 +406,16 @@ void __cdecl InitLevelMonsters() uniquetrans = 0; } -// 64CCE0: using guessed type int MissileFileFlag; -// 658550: using guessed type int totalmonsters; -// 6599D9: using guessed type int END_Monsters_17; -// 659AE8: using guessed type int monstimgtot; int __fastcall AddMonsterType(int type, int placeflag) { - bool done; // eax - int i; // esi + BOOL done; + int i; - done = 0; + done = FALSE; - for ( i = 0; i < nummtypes; i++ ) + for ( i = 0; i < nummtypes && !done; i++ ) { - if ( done ) - break; - done = type == Monsters[i].mtype; } @@ -439,7 +432,6 @@ int __fastcall AddMonsterType(int type, int placeflag) Monsters[i].mPlaceFlags |= placeflag; return i; } -// 659AE8: using guessed type int monstimgtot; void __cdecl GetLevelMTypes() /* note-decompile this function again and check */ {