aboutsummaryrefslogtreecommitdiff
path: root/src/pathfinder.cpp
Commit message (Expand)AuthorAge
* Reserve vectors before pushing and other code quality changes (#11161)sfan52021-04-05
* Remove dead code (#10845)rubenwardy2021-01-22
* Reduce ServerEnvironment propagation (#9642)Loïc Blot2020-04-11
* Fix pathfinder bugs: returning nil frequently, broken A*, jump through solid ...Wuzzy2020-03-05
* Merge pull request #8776 from osjc/FixGetNodeJozef Behran2019-08-10
* Optimize path finalization in pathfinder (#8100)Jozef Behran2019-01-12
* Node definition manager refactor (#7016)Dániel Juhász2018-02-10
* Code modernization: src/n*, src/o* (#6280)Loïc Blot2017-08-19
* Fix various copy instead of const ref reported by cppcheck (part 3) (#5616)Loïc Blot2017-04-20
* Pathfinder: Send errors to `warningstream`.Diego Martínez2017-03-27
* Environment & IGameDef code refactoring (#4985)Ner'zhul2017-01-09
* Move ServerEnvironment to dedicated cpp/header filesLoic Blot2017-01-08
* Move PP() and PP2() macros to basic_macros.hRogier2016-12-24
* find_path: consider walkable instead of CONTENT_AIRAuke Kok2016-05-01
* Pathfinder: improve GridNode storageest312016-05-01
* Pathfinder: use core::aabbox3d instead of own typeest312016-05-01
* Pathfinder: Fix styleest312016-05-01
* Move pathfinder classes to cpp fileest312016-05-01
* Change i++ to ++iDavid Jones2015-08-25
* Fix pathfinder to produce more useful pathsobneq2015-05-03
* Remove noisy error messages, prepend "pathfinder: " to pathfinder messagessapier2014-02-03
* Fix bug in pathfinder causing endless loop in some situationssapier2013-08-31
* Use errorstream instead of std::cout in pathfinder.cppPilzAdam2013-08-16
* Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenuKahrl2013-08-14
* Math mapgen fix, ip show on connect, pathfinder segfault fixproller2013-06-23
* fix bug in scriptapi line_of_sightsapier2013-04-10
* Add Dijkstra A* and A* without prefetching pathfind algorithmssapier2013-04-06
#define CONTENT_CHEST 15 #define CONTENT_FURNACE 16 #define CONTENT_LOCKABLE_CHEST 17 #define CONTENT_FENCE 21 #define CONTENT_RAIL 30 #define CONTENT_LADDER 31 #define CONTENT_LAVA 32 #define CONTENT_LAVASOURCE 33 #define CONTENT_GRASS 0x800 //1 #define CONTENT_TREE 0x801 //4 #define CONTENT_LEAVES 0x802 //5 #define CONTENT_GRASS_FOOTSTEPS 0x803 //6 #define CONTENT_MESE 0x804 //7 #define CONTENT_MUD 0x805 //8 #define CONTENT_CLOUD 0x806 //10 #define CONTENT_COALSTONE 0x807 //11 #define CONTENT_WOOD 0x808 //12 #define CONTENT_SAND 0x809 //13 #define CONTENT_COBBLE 0x80a //18 #define CONTENT_STEEL 0x80b //19 #define CONTENT_GLASS 0x80c //20 #define CONTENT_MOSSYCOBBLE 0x80d //22 #define CONTENT_GRAVEL 0x80e //23 #define CONTENT_SANDSTONE 0x80f //24 #define CONTENT_CACTUS 0x810 //25 #define CONTENT_BRICK 0x811 //26 #define CONTENT_CLAY 0x812 //27 #define CONTENT_PAPYRUS 0x813 //28 #define CONTENT_BOOKSHELF 0x814 //29 #define CONTENT_JUNGLETREE 0x815 #define CONTENT_JUNGLEGRASS 0x816 #define CONTENT_NC 0x817 #define CONTENT_NC_RB 0x818 #define CONTENT_APPLE 0x819 #define CONTENT_SAPLING 0x820 /* A conversion table for backwards compatibility. Maps <=v19 content types to current ones. Should never be touched. */ content_t trans_table_19[21][2] = { {CONTENT_GRASS, 1}, {CONTENT_TREE, 4}, {CONTENT_LEAVES, 5}, {CONTENT_GRASS_FOOTSTEPS, 6}, {CONTENT_MESE, 7}, {CONTENT_MUD, 8}, {CONTENT_CLOUD, 10}, {CONTENT_COALSTONE, 11}, {CONTENT_WOOD, 12}, {CONTENT_SAND, 13}, {CONTENT_COBBLE, 18}, {CONTENT_STEEL, 19}, {CONTENT_GLASS, 20}, {CONTENT_MOSSYCOBBLE, 22}, {CONTENT_GRAVEL, 23}, {CONTENT_SANDSTONE, 24}, {CONTENT_CACTUS, 25}, {CONTENT_BRICK, 26}, {CONTENT_CLAY, 27}, {CONTENT_PAPYRUS, 28}, {CONTENT_BOOKSHELF, 29}, }; MapNode mapnode_translate_to_internal(MapNode n_from, u8 version) { MapNode result = n_from; if(version <= 19) { content_t c_from = n_from.getContent(); for(u32 i=0; i<sizeof(trans_table_19)/sizeof(trans_table_19[0]); i++) { if(trans_table_19[i][1] == c_from) { result.setContent(trans_table_19[i][0]); break; } } } return result; } void content_mapnode_get_name_id_mapping(NameIdMapping *nimap) { nimap->set(0, "default:stone"); nimap->set(2, "default:water_flowing"); nimap->set(3, "default:torch"); nimap->set(9, "default:water_source"); nimap->set(14, "default:sign_wall"); nimap->set(15, "default:chest"); nimap->set(16, "default:furnace"); nimap->set(17, "default:chest_locked"); nimap->set(21, "default:fence_wood"); nimap->set(30, "default:rail"); nimap->set(31, "default:ladder"); nimap->set(32, "default:lava_flowing"); nimap->set(33, "default:lava_source"); nimap->set(0x800, "default:dirt_with_grass"); nimap->set(0x801, "default:tree"); nimap->set(0x802, "default:leaves"); nimap->set(0x803, "default:dirt_with_grass_footsteps"); nimap->set(0x804, "default:mese"); nimap->set(0x805, "default:dirt"); nimap->set(0x806, "default:cloud"); nimap->set(0x807, "default:coalstone"); nimap->set(0x808, "default:wood"); nimap->set(0x809, "default:sand"); nimap->set(0x80a, "default:cobble"); nimap->set(0x80b, "default:steelblock"); nimap->set(0x80c, "default:glass"); nimap->set(0x80d, "default:mossycobble"); nimap->set(0x80e, "default:gravel"); nimap->set(0x80f, "default:sandstone"); nimap->set(0x810, "default:cactus"); nimap->set(0x811, "default:brick"); nimap->set(0x812, "default:clay"); nimap->set(0x813, "default:papyrus"); nimap->set(0x814, "default:bookshelf"); nimap->set(0x815, "default:jungletree"); nimap->set(0x816, "default:junglegrass"); nimap->set(0x817, "default:nyancat"); nimap->set(0x818, "default:nyancat_rainbow"); nimap->set(0x819, "default:apple"); nimap->set(0x820, "default:sapling"); // Static types nimap->set(CONTENT_IGNORE, "ignore"); nimap->set(CONTENT_AIR, "air"); }