| 2155 | } |
| 2156 | |
| 2157 | bool Creature::tryDrop(Seat* seat, Tile* tile) |
| 2158 | { |
| 2159 | // check whether the tile is a ground tile ... |
| 2160 | if(tile->isFullTile()) |
| 2161 | return false; |
| 2162 | |
| 2163 | // In editor mode, we allow creatures to be dropped anywhere they can walk |
| 2164 | if(getGameMap()->isInEditorMode() && canGoThroughTile(tile)) |
| 2165 | return true; |
| 2166 | |
| 2167 | // we cannot drop a creature on a tile we don't see |
| 2168 | if(!seat->hasVisionOnTile(tile)) |
| 2169 | return false; |
| 2170 | |
| 2171 | // If it is a worker, he can be dropped on dirt |
| 2172 | if (getDefinition()->isWorker() && (tile->getTileVisual() == TileVisual::dirtGround || tile->getTileVisual() == TileVisual::goldGround)) |
| 2173 | return true; |
| 2174 | |
| 2175 | // Every creature can be dropped on allied claimed tiles |
| 2176 | if(tile->isClaimedForSeat(seat)) |
| 2177 | return true; |
| 2178 | |
| 2179 | return false; |
| 2180 | } |
| 2181 | |
| 2182 | void Creature::drop(const Ogre::Vector3& v) |
| 2183 | { |
nothing calls this directly
no test coverage detected