Browse Source

👑 Fix to bug that made spawned monsters overwrite alive ones (cause was monsters not being properly deleted)

pull/2378/head
FluffyQuack 5 years ago committed by Anders Jenbo
parent
commit
c4a96bc829
  1. 2
      Source/monster.cpp

2
Source/monster.cpp

@ -797,7 +797,7 @@ void LoadDiabMonsts()
void DeleteMonster(int i)
{
ActiveMonsterCount--;
ActiveMonsters[i] = ActiveMonsters[ActiveMonsterCount];
std::swap(ActiveMonsters[i], ActiveMonsters[ActiveMonsterCount]); // This ensures alive monsters are before ActiveMonsterCount in the array and any deleted monster after
}
void NewMonsterAnim(MonsterStruct &monster, MonsterGraphic graphic, Direction md, AnimationDistributionFlags flags = AnimationDistributionFlags::None, int numSkippedFrames = 0, int distributeFramesBeforeFrame = 0)

Loading…
Cancel
Save