diff --git a/Source/objects.cpp b/Source/objects.cpp index 5651a404a..d20703324 100644 --- a/Source/objects.cpp +++ b/Source/objects.cpp @@ -423,22 +423,21 @@ void __cdecl FreeObjectGFX() } // 67D7C4: using guessed type int numobjfiles; -BOOLEAN __fastcall RndLocOk(int xp, int yp) -{ - int v2; // ecx - int v3; // eax - int v4; // eax - BOOLEAN result; // eax - - v2 = xp; - v3 = v2 * 112 + yp; - result = 0; - if (!dMonster[0][v3] && !dPlayer[v2][yp] && !dObject[v2][yp] && !(dFlags[v2][yp] & DFLAG_POPULATED)) { - v4 = dPiece[0][v3]; - if (!nSolidTable[v4] && (leveltype != 1 || v4 <= 126 || v4 >= 144)) - result = 1; - } - return result; +BOOL __fastcall RndLocOk(int xp, int yp) +{ + if (dMonster[xp][yp]) + return FALSE; + if (dPlayer[xp][yp]) + return FALSE; + if (dObject[xp][yp]) + return FALSE; + if (dFlags[xp][yp] & DFLAG_POPULATED) + return FALSE; + if (nSolidTable[dPiece[xp][yp]]) + return FALSE; + if (leveltype != 1 || dPiece[xp][yp] <= 126 || dPiece[xp][yp] >= 144) + return TRUE; + return FALSE; } void __fastcall InitRndLocObj(int min, int max, int objtype) diff --git a/Source/objects.h b/Source/objects.h index cad0f5a13..86cce099d 100644 --- a/Source/objects.h +++ b/Source/objects.h @@ -16,7 +16,7 @@ extern int numobjfiles; // weak void __cdecl InitObjectGFX(); void __cdecl FreeObjectGFX(); -BOOLEAN __fastcall RndLocOk(int xp, int yp); +BOOL __fastcall RndLocOk(int xp, int yp); void __fastcall InitRndLocObj(int min, int max, int objtype); void __fastcall InitRndLocBigObj(int min, int max, int objtype); void __fastcall InitRndLocObj5x5(int min, int max, int objtype);