MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / consoleSetCreatureDestination

Method consoleSetCreatureDestination

source/gamemap/GameMap.cpp:2722–2734  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2720}
2721
2722void GameMap::consoleSetCreatureDestination(const std::string& creatureName, int x, int y)
2723{
2724 Creature* creature = getCreature(creatureName);
2725 if(creature == nullptr)
2726 return;
2727 Tile* tile = getTile(x, y);
2728 if(tile == nullptr)
2729 return;
2730 if(creature->getPositionTile() == nullptr)
2731 return;
2732 creature->clearActionQueue();
2733 creature->setDestination(tile);
2734}
2735
2736void GameMap::consoleToggleCreatureVisualDebug(const std::string& creatureName)
2737{

Callers 1

cSrvSetCreatureDestFunction · 0.80

Calls 3

getPositionTileMethod · 0.80
clearActionQueueMethod · 0.80
setDestinationMethod · 0.80

Tested by

no test coverage detected