Open spacehamster opened 6 years ago
Seems like my recent commits which adds smart pointers are horrible =/
Try to use 121b512c155da94b59e7990f0a9226a19e78e2ed
for mapgen-viewer
and dd14a6b5e491b0bce52b7f885f424e9621e0f740
for libmapgen
I am not very experienced c++ developer to fix segfaults quickly =( But if you can, i will be very grateful.
I use pathfinding in my other project and with possibly better approach: https://github.com/averrin/lss/blob/master/src/game/location.cpp#L285
The older commit without smart pointer works great
Nice. I will move recent commits to experimental branches. Thanks for using my code. Despite the problems.
If i run the following
I get a read access violation in Map::getRegionDistance trying to read from std::shared_ptrr.
I think this may be related to passing in a raw pointer
Region *
in Simulator.cpp makeRoad and then casting them back to shared_ptr in LeastCostEstimate? Or in AdjactedCost the micropather is given a reference to n which immediatly falls out of scope?I tried changing
to
and
to
in AdjacentCost but then it crashes while trying to delete cities in removeBadPorts