Fix transportable object damage rules

This makes the rules match the original Colobot like they were supposed to
1008-fix
krzys-h 2018-05-07 20:21:57 +02:00
parent fdf67b8217
commit 1d09ee9b3c
1 changed files with 6 additions and 1 deletions

View File

@ -358,7 +358,12 @@ bool COldObject::DamageObject(DamageType type, float force, CObject* killer)
else if ( Implements(ObjectInterfaceType::Fragile) )
{
if ( m_type == OBJECT_BOMB && type != DamageType::Explosive ) return false; // Mine can't be destroyed by shooting
if ( m_type == OBJECT_URANIUM ) return false; // UraniumOre is not destroyable (see #777)
if ( m_type == OBJECT_URANIUM && (type == DamageType::Fire || type == DamageType::Organic) ) return false; // UraniumOre is not destroyable by shooting or aliens (see #777)
if ( m_type == OBJECT_STONE && (type == DamageType::Fire || type == DamageType::Organic) ) return false; // TitaniumOre is not destroyable either
// PowerCell, NuclearCell and Titanium are destroyable by shooting, but not by collisions!
if ( m_type == OBJECT_METAL && type == DamageType::Collision ) return false;
if ( m_type == OBJECT_POWER && type == DamageType::Collision ) return false;
if ( m_type == OBJECT_NUCLEAR && type == DamageType::Collision ) return false;
DestroyObject(DestructionType::Explosion, killer);
return true;