- fixed: Giving several morph items in the same tic could lead to an invalid Owner pointer in APowerupGiver::Use.

This commit is contained in:
Christoph Oelckers 2016-11-29 20:28:04 +01:00
parent 9193466572
commit 4372a14479

View file

@ -72,6 +72,7 @@ DEFINE_FIELD(APowerupGiver, Strength)
bool APowerupGiver::Use (bool pickup) bool APowerupGiver::Use (bool pickup)
{ {
if (PowerupType == NULL) return true; // item is useless if (PowerupType == NULL) return true; // item is useless
if (Owner == nullptr) return true;
APowerup *power = static_cast<APowerup *> (Spawn (PowerupType)); APowerup *power = static_cast<APowerup *> (Spawn (PowerupType));