Ticket #3530: t3530_throw_warnings.patch

File t3530_throw_warnings.patch, 845 bytes (added by elexis, 9 years ago)

There might be other cases where an illegal unit shape obstruction (one with clearance 0) is added. We should warn in that case.

  • source/simulation2/components/CCmpObstructionManager.cpp

    public:  
    272272        }
    273273    }
    274274
    275275    virtual tag_t AddUnitShape(entity_id_t ent, entity_pos_t x, entity_pos_t z, entity_pos_t clearance, flags_t flags, entity_id_t group)
    276276    {
     277        if (clearance == entity_pos_t::Zero())
     278            LOGWARNING("Adding unit shape obstruction with clearance zero for entity %d!", ent);
     279
    277280        UnitShape shape = { ent, x, z, clearance, flags, group };
    278281        u32 id = m_UnitShapeNext++;
    279282        m_UnitShapes[id] = shape;
    280283
    281284        m_UnitSubdivision.Add(id, CFixedVector2D(x - clearance, z - clearance), CFixedVector2D(x + clearance, z + clearance));