@ -63,6 +63,8 @@ Crawler::Crawler()
std : : string MONSTERSTRATEGIES_CONFIG = CONFIG_PATH + " monsterstrategies_config " _S ;
utils : : datafile : : Read ( DATA , MONSTERSTRATEGIES_CONFIG ) ;
DEBUG_PATHFINDING = " debug_pathfinding " _I ;
for ( std : : string & cl : DATA . GetProperty ( " class_list " ) . GetValues ( ) ) {
std : : cout < < cl < < std : : endl ;
utils : : datafile : : Read ( DATA , CONFIG_PATH + " class_directory " _S + cl + " .txt " ) ;
@ -743,6 +745,13 @@ void Crawler::RenderWorld(float fElapsedTime){
std : : string text = std : : to_string ( dn - > damage ) ;
view . DrawStringPropDecal ( dn - > pos - GetTextSizeProp ( text ) / 2 , text , DARK_RED ) ;
}
if ( DEBUG_PATHFINDING ) {
std : : vector < vf2d > pathing = game - > pathfinder . Solve_AStar ( player . get ( ) - > GetPos ( ) , GetWorldMousePos ( ) , 8 , player . get ( ) - > OnUpperLevel ( ) ) ;
for ( vf2d & square : pathing ) {
view . FillRectDecal ( square * 24 , { 24 , 24 } , DARK_GREEN ) ;
}
}
}
Player * Crawler : : GetPlayer ( ) {
@ -1077,7 +1086,7 @@ geom2d::rect<int>Crawler::GetTileCollision(MapName map,vf2d pos,bool upperLevel)
if ( ! upperLevel ) { //We are looking for lower bridge collisions.
for ( geom2d : : rect < int > & zone : MAP_DATA [ map ] . ZoneData [ " LowerBridgeCollision " ] ) {
if ( geom2d : : contains ( zone , pos ) ) {
return { { 0 , 0 } , { 3 2, 3 2} } ;
return { { 0 , 0 } , { 24 , 24 } } ;
}
}
}