Nexela / Nanobots

Early version of ghost building construction bots. Allows researching automated construction earlier (for blueprints etc)
MIT License
31 stars 22 forks source link

Attempting to replace tile throws exception #98

Closed phoenixuprising closed 5 years ago

phoenixuprising commented 5 years ago

If you have a tile down such as a stone-brick and place a concrete ghost over it, an exception will be thrown because calling player.mine_tile invalidates the ghost. This causes the original tile to be removed (mined) and the ghost to be cleared but the new tile is not placed and the item isn't returned to inventory. Instead, we allow the mining to be attempted and then check if the ghost is still valid. Finally, if the tile was mined, we have to manually set the tile since we can't revive the ghost.