Browse Source

Theme_Barrel bin exact

pull/25/head
Robin Eklind 8 years ago
parent
commit
17874b033a
  1. 19
      Source/themes.cpp

19
Source/themes.cpp

@ -703,13 +703,17 @@ void __fastcall PlaceThemeMonsts(int t, int f)
} }
// 45D0E1: using guessed type int var_1D0[111]; // 45D0E1: using guessed type int var_1D0[111];
// Theme_Barrel initializes the barrel theme.
//
// Parameters:
// - t: theme number (index into themes array).
void __fastcall Theme_Barrel(int t) void __fastcall Theme_Barrel(int t)
{ {
int yp; // edi int xp;
int xp; // ebx int yp;
int r; int r;
char monstrnd[4];
char barrnd[4]; char barrnd[4];
char monstrnd[4];
barrnd[0] = 2; barrnd[0] = 2;
barrnd[1] = 6; barrnd[1] = 6;
@ -719,18 +723,17 @@ void __fastcall Theme_Barrel(int t)
monstrnd[1] = 7; monstrnd[1] = 7;
monstrnd[2] = 3; monstrnd[2] = 3;
monstrnd[3] = 9; monstrnd[3] = 9;
for (yp = 0; yp < 112; yp++) { for (yp = 0; yp < 112; yp++) {
for (xp = 0; xp < 112; xp++) { for (xp = 0; xp < 112; xp++) {
if (dung_map[xp][yp] == themes[t].ttval && !nSolidTable[dPiece[xp][yp]]) { if (dung_map[xp][yp] == themes[t].ttval && !nSolidTable[dPiece[xp][yp]]) {
if (!random(0, barrnd[leveltype - 1])) { if (random(0, barrnd[leveltype - 1]) == 0) {
r = random(0, barrnd[leveltype - 1]); r = random(0, barrnd[leveltype - 1]) != 0;
AddObject((r != 0) + OBJ_BARREL, xp, yp); r += OBJ_BARREL;
AddObject(r, xp, yp);
} }
} }
} }
} }
PlaceThemeMonsts(t, monstrnd[leveltype - 1]); PlaceThemeMonsts(t, monstrnd[leveltype - 1]);
} }

Loading…
Cancel
Save