Pocketmine-mp: Misuse of Entity->kill() vs Entity->close() cause crashes

Created on 19 Mar 2017  路  3Comments  路  Source: pmmp/PocketMine-MP

A crash may occur when an arrow despawns due to the use of kill(). This is due to the deadTicks timeout to allow entity death animations to be shown, arrows will be updated 10x after dying, and will repeatedly call kill() on themselves until that 10 ticks is done. deadTicks should not be hardcoded to 10, and arrows should be using close() since they _despawn_, not die.

Steps to reproduce

Shoot an arrow, wait for it to despawn

Core Fixed

All 3 comments

There is also a bad lack of documentation of Entity API methods.

I have addParticle on a null when I throw arrows out of client sight (so when they are unloaded ?), is it linked to this ?

@Guillaume351 very likely, yes. I saw several issues like this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JoshuaACasey picture JoshuaACasey  路  3Comments

XDqrkneZ picture XDqrkneZ  路  3Comments

TheDiamondYT1 picture TheDiamondYT1  路  3Comments

L3ice picture L3ice  路  3Comments

SuperAdam47 picture SuperAdam47  路  3Comments