mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-09-23 09:02:27 +00:00
fix(wither): move livingEntitySelector from static to per-instance
Withers were previously using the same static LES pointer (which gets destroyed on death) causing a segfault when another wither is spawned after the first one is dead
This commit is contained in:
@@ -51,9 +51,9 @@ bool LivingEntitySelector::matches(std::shared_ptr<Entity> entity) const {
|
||||
}
|
||||
}
|
||||
|
||||
EntitySelector* WitherBoss::livingEntitySelector = new LivingEntitySelector();
|
||||
|
||||
WitherBoss::WitherBoss(Level* level) : Monster(level) {
|
||||
// 4jcraft: moved to per-instance
|
||||
livingEntitySelector = new LivingEntitySelector();
|
||||
// 4J Stu - This function call had to be moved here from the Entity ctor to
|
||||
// ensure that the derived version of the function is called
|
||||
this->defineSynchedData();
|
||||
|
||||
@@ -43,7 +43,8 @@ private:
|
||||
int idleHeadUpdates[IDLE_HEAD_UPDATES_SIZE];
|
||||
int destroyBlocksTick;
|
||||
|
||||
static EntitySelector* livingEntitySelector;
|
||||
// 4jcraft: moved to per-instance
|
||||
EntitySelector* livingEntitySelector;
|
||||
|
||||
public:
|
||||
WitherBoss(Level* level);
|
||||
|
||||
Reference in New Issue
Block a user