Ramparts do not protect structure against dismantle()



  • [Update: I mixed up things, everything works as expected. See comments.]

    The docs say that a rampart "defends your creeps and structures on the same tile". So a creep cannot attack() a structure placed on a rampart, but automatically attacks the rampart instead. However, creep.dismantle(structure) does not have that restriction, which is surprising when compared to the sentence quoted above.

    I think this should work the same way: ramparts need to protect structures from dismantling, and dismantle() should automatically target a rampart instead of the targeted structure.

    At the very least, if this difference is kept, it needs to be documented.


  • Culture

    They should be defended. I've created a PR for fixing dismantling your own structures under your own ramparts. 

     

    Are you trying to dismantle your own structures?



  • No, I used the simulation to create a tower and a rampart for Player 2, then switched back to myself, created a creep and issued a dismantle() command.



  • I repeated my test and could not reproduce the issue. Obviously I must have mixed up things the first time 😞

    Thanks for the answer.