[Orxonox-commit 3876] r8550 - code/branches/gameimmersion/src/modules/weapons/projectiles

simonmie at orxonox.net simonmie at orxonox.net
Mon May 23 17:59:49 CEST 2011


Author: simonmie
Date: 2011-05-23 17:59:48 +0200 (Mon, 23 May 2011)
New Revision: 8550

Modified:
   code/branches/gameimmersion/src/modules/weapons/projectiles/BasicProjectile.cc
Log:
again comments for BasicProjectile

Modified: code/branches/gameimmersion/src/modules/weapons/projectiles/BasicProjectile.cc
===================================================================
--- code/branches/gameimmersion/src/modules/weapons/projectiles/BasicProjectile.cc	2011-05-23 15:46:47 UTC (rev 8549)
+++ code/branches/gameimmersion/src/modules/weapons/projectiles/BasicProjectile.cc	2011-05-23 15:59:48 UTC (rev 8550)
@@ -49,6 +49,8 @@
 
         this->bDestroy_ = false;
 
+        // Default damage must be zero, otherwise it would be above zero if no settings are made in the weaponsettings xml file.
+        // same thing for all weaponmodes files
         this->damage_ = 0;
         this->healthdamage_ = 0;
         this->shielddamage_ = 0;
@@ -88,7 +90,9 @@
             // visual effects for being hit, depending on whether the shield is hit or not
             if (owner) //if the owner does not exist (anymore?), no effects are displayed.
             {
-                if (!victim || (victim && !victim->hasShield()))
+                // damping and explosion effect is only played if the victim is no pawn (see cast above)
+                // or if the victim is a pawn, has no shield left, is still alive and any damage goes to the health
+                if (!victim || (victim && !victim->hasShield() && victim->getHealth() > 0 && (this_->getDamage() > 0 || this_->getHealthDamage() > 0)))
                 {
                     {
                         ParticleSpawner* effect = new ParticleSpawner(owner->getCreator());




More information about the Orxonox-commit mailing list