[Orxonox-commit 5610] r10270 - code/trunk/src/orxonox/worldentities/pawns
landauf at orxonox.net
landauf at orxonox.net
Sat Feb 14 22:49:23 CET 2015
Author: landauf
Date: 2015-02-14 22:49:23 +0100 (Sat, 14 Feb 2015)
New Revision: 10270
Modified:
code/trunk/src/orxonox/worldentities/pawns/ModularSpaceShip.cc
Log:
fixed crash: cs can be null (e.g. when using the 'suicide' command)
Modified: code/trunk/src/orxonox/worldentities/pawns/ModularSpaceShip.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/ModularSpaceShip.cc 2015-02-14 11:51:14 UTC (rev 10269)
+++ code/trunk/src/orxonox/worldentities/pawns/ModularSpaceShip.cc 2015-02-14 21:49:23 UTC (rev 10270)
@@ -158,7 +158,7 @@
*/
void ModularSpaceShip::damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs)
{
- if (this->getPartOfEntity((StaticEntity*)(cs->getUserPointer())) != NULL)
+ if (cs != NULL && this->getPartOfEntity((StaticEntity*)(cs->getUserPointer())) != NULL)
this->getPartOfEntity((StaticEntity*)(cs->getUserPointer()))->handleHit(damage, healthdamage, shielddamage, originator);
else
SpaceShip::damage(damage, healthdamage, shielddamage, originator, cs);
More information about the Orxonox-commit
mailing list