| 149 | } |
| 150 | |
| 151 | bool TreasuryObject::tryDrop(Seat* seat, Tile* tile) |
| 152 | { |
| 153 | if (tile->isFullTile()) |
| 154 | return false; |
| 155 | |
| 156 | // In editor mode, we allow to drop an object in dirt, claimed or gold tiles |
| 157 | if(getGameMap()->isInEditorMode() && |
| 158 | (tile->getTileVisual() == TileVisual::dirtGround || tile->getTileVisual() == TileVisual::goldGround || tile->getTileVisual() == TileVisual::rockGround)) |
| 159 | { |
| 160 | return true; |
| 161 | } |
| 162 | |
| 163 | // we cannot drop an object on a tile we don't see |
| 164 | if(!seat->hasVisionOnTile(tile)) |
| 165 | return false; |
| 166 | |
| 167 | // Otherwise, we allow to drop an object only on allied claimed tiles |
| 168 | if(tile->isClaimedForSeat(seat)) |
| 169 | return true; |
| 170 | |
| 171 | return false; |
| 172 | } |
| 173 | |
| 174 | void TreasuryObject::addEntityToPositionTile() |
| 175 | { |
nothing calls this directly
no test coverage detected