Opened 8 years ago

Last modified 3 years ago

#4260 new defect

CCmpSelectable.cpp segfaults when selecting a building without footprint — at Version 1

Reported by: elexis Owned by:
Priority: If Time Permits Milestone: Backlog
Component: Simulation Keywords: simple
Cc: Patch:

Description (last modified by Mohamed Moanis)

Reproduce: remove <Footprint> from binaries/data/mods/public/simulation/templates/template_structure_civic_civil_centre.xml and start a game, select the cc.

Stack:

0x000000000052ab6d in CCmpSelectable::RenderSubmit (collector=..., this=0x526b460)
    at ../../../source/simulation2/components/CCmpSelectable.cpp:629
629						m_BuildingOverlay->m_Color = m_Color; // done separately so alpha changes don't require a full update call

The cpp component shouldn't crash in such a case but detect the missing footprint component when trying to access it, show an error message and exit gracefully.

Furthermore the GetSchema() should be extended to require Footprint.

Change History (1)

comment:1 by Mohamed Moanis, 7 years ago

Description: modified (diff)

Can I own this ticket. I already fixed the crash and can submit a patch for review. I just have 1 question about the change in the schema; do you mean the schema in the CCmpSelectable class, should contain require Footprint?

Note: See TracTickets for help on using tickets.