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

Method castSpell

source/spells/SpellSummonWorker.cpp:158–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156}
157
158bool SpellSummonWorker::castSpell(GameMap* gameMap, Player* player, ODPacket& packet)
159{
160 uint32_t nbTiles;
161 OD_ASSERT_TRUE(packet >> nbTiles);
162 std::vector<Tile*> tiles;
163 while(nbTiles > 0)
164 {
165 --nbTiles;
166 Tile* tile = gameMap->tileFromPacket(packet);
167 if(tile == nullptr)
168 return false;
169
170 tiles.push_back(tile);
171 }
172
173 if(tiles.empty())
174 return false;
175
176 return summonWorkersOnTiles(gameMap, player, tiles);
177}
178
179bool SpellSummonWorker::summonWorkersOnTiles(GameMap* gameMap, Player* player, const std::vector<Tile*>& tiles)
180{

Callers

nothing calls this directly

Calls 1

tileFromPacketMethod · 0.80

Tested by

no test coverage detected