From fb87bab3eb0305d912571e548eac358f08238513 Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Wed, 12 Aug 2020 11:20:28 +0200 Subject: [PATCH] Fixing explosive barrels prespawning skeletons The AddBarrel function was not checking the type of the barrel when generating the oVar2. This led to skeletons being pre-spawned in explosive barrels; except that explosive barrels do not trigger the spawn, resulting in unreachable monsters sitting at (0, 0) even after a full clear. While this does not affect functionality of regular Diablo gameplay, it potentially affects modders who would like to use the nummonsters global variable to check for full clears. --- Source/objects.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/objects.cpp b/Source/objects.cpp index 238801947..9593b1f86 100644 --- a/Source/objects.cpp +++ b/Source/objects.cpp @@ -1100,7 +1100,7 @@ void AddBarrel(int i, int t) { object[i]._oVar1 = 0; object[i]._oRndSeed = GetRndSeed(); - object[i]._oVar2 = random_(149, 10); + object[i]._oVar2 = (t == OBJ_BARRELEX) ? 0 : random_(149, 10); object[i]._oVar3 = random_(149, 3); if (object[i]._oVar2 >= 8)