mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-05-29 22:22:53 +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:
parent
63ab8d1b20
commit
342a195ba8
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue