예제 #1
0
/// Findet einen Weg für Figuren
unsigned char GameWorldBase::FindHumanPath(const MapPoint start, 
        const MapPoint dest, const unsigned max_route, const bool random_route, unsigned* length, const bool record) const
{
    // Aus Replay lesen?
    if(GAMECLIENT.ArePathfindingResultsAvailable() && !random_route)
    {
        unsigned char dir;
        if(GAMECLIENT.ReadPathfindingResult(&dir, length, NULL))
            return dir;
    }

    unsigned char first_dir = INVALID_DIR;
    GetFreePathFinder().FindPath(start, dest, random_route, max_route, NULL, length, &first_dir, PathConditionHuman(*this), record);

    if(!random_route)
        GAMECLIENT.AddPathfindingResult(first_dir, length, NULL);

    return first_dir;

}
예제 #2
0
/// Findet einen Weg für Figuren
unsigned char GameWorldBase::FindHumanPath(const MapPoint start, const MapPoint dest, const unsigned max_route, const bool random_route, unsigned* length) const
{
    unsigned char first_dir = INVALID_DIR;
    GetFreePathFinder().FindPath(start, dest, random_route, max_route, NULL, length, &first_dir, PathConditionHuman(*this));
    return first_dir;
}
bool nofGeologist::IsNodeGood(const MapPoint pt) const
{
    // Es dürfen auch keine bestimmten Objekte darauf stehen und auch keine Schilder !!
    const noBase& obj = *gwg->GetNO(pt);
    return PathConditionHuman(*gwg).IsNodeOk(pt) && obj.GetGOT() != GOT_SIGN && obj.GetType() != NOP_FLAG && obj.GetType() != NOP_TREE;
}