MCPcopy Create free account
hub / github.com/CleverRaven/Cataclysm-DDA / check

Method check

src/mapdata.cpp:1464–1511  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1462}
1463
1464void ter_t::check() const
1465{
1466 map_data_common_t::check();
1467 check_bash_items( bash, id.str(), true );
1468 check_decon_items( deconstruct, id.str(), true );
1469
1470 if( !transforms_into.is_valid() ) {
1471 debugmsg( "invalid transforms_into %s for %s", transforms_into.c_str(), id.c_str() );
1472 }
1473
1474 // Validate open/close transforms
1475 if( !open.is_valid() ) {
1476 debugmsg( "invalid terrain %s for opening %s", open.c_str(), id.c_str() );
1477 }
1478 if( !close.is_valid() ) {
1479 debugmsg( "invalid terrain %s for closing %s", close.c_str(), id.c_str() );
1480 }
1481 // Check transition consistency for opening/closing terrain. Has an obvious
1482 // exception for locked terrains - those aren't expected to be locked again
1483 if( open && open->close && open->close != id && !has_flag( ter_furn_flag::TFLAG_LOCKED ) ) {
1484 debugmsg( "opening terrain %s for %s doesn't reciprocate", open.c_str(), id.c_str() );
1485 }
1486 if( close && close->open && close->open != id && !has_flag( ter_furn_flag::TFLAG_LOCKED ) ) {
1487 debugmsg( "closing terrain %s for %s doesn't reciprocate", close.c_str(), id.c_str() );
1488 }
1489
1490 // Validate curtain transforms
1491 if( has_examine( iexamine::curtains ) && !has_curtains() ) {
1492 debugmsg( "%s is a curtain, but has no curtain_transform", id.c_str() );
1493 }
1494 if( !has_examine( iexamine::curtains ) && has_curtains() ) {
1495 debugmsg( "%s is not a curtain, but has curtain_transform", id.c_str() );
1496 }
1497 if( !curtain_transform.is_empty() && !curtain_transform.is_valid() ) {
1498 debugmsg( "%s has invalid curtain transform target %s", id.c_str(), curtain_transform.c_str() );
1499 }
1500
1501 // Validate generic transforms
1502 if( transforms_into && transforms_into == id ) {
1503 debugmsg( "%s transforms_into itself", id.c_str() );
1504 }
1505
1506 for( const emit_id &e : emissions ) {
1507 if( !e.is_valid() ) {
1508 debugmsg( "ter %s has invalid emission %s set", id.c_str(), e.str().c_str() );
1509 }
1510 }
1511}
1512
1513furn_t::furn_t() : open( furn_str_id::NULL_ID() ), close( furn_str_id::NULL_ID() ) {}
1514

Callers 1

Calls 7

check_bash_itemsFunction · 0.85
check_decon_itemsFunction · 0.85
checkFunction · 0.70
strMethod · 0.45
is_validMethod · 0.45
c_strMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected