Page 1 of 1

[kovarex] [0.17.49] Removing trains in editor results in not mineable rails

Posted: Sun Jun 16, 2019 11:53 am
by TxT
Hi guys,

this is my first report, I hope Im doing everything right ;)

I cloned some rail network in the new editor (rails and trains on some rails), then I used the decon planner to get rid of some parts (including the trains), now I cant mine the rails anymore (neither in editor nor in normal game)!

Even after placing a new train and removing it by hand in the normal game, I cant remove the rails. Taking a look at its properties in the editor it has the not mineable property set.

again I hope I did everything right and this wasnt already reported before!

Re: [0.17.49] Removing trains in editor results in not mineable rails

Posted: Sun Jun 16, 2019 12:17 pm
by TxT
I just played a little more around with and seems to only work when you clone the rail with the train on it first and it only affects the newly created rails

Re: [0.17.49] Removing trains in editor results in not mineable rails

Posted: Sun Jun 16, 2019 9:12 pm
by boskid
Indeed, can reproduce:
1/ open editor
2/ place 3 straight tracks
3/ place locomotive - this action marks all 3 straight tracks to be "not minable"
4/ in editor select "clone"
5/ mark rails and locomotive
6/ paste clone somewhere else
7/ remove cloned locomotive

What happend:
- rails under removed (clone) locomotive have attribute "not minable" still set
What expected:
- removing clone locomotive should clear "not minable" attribute in clone tracks

---
this feels like

Code: Select all

bool Rail::isNonMinable() {
  if(trainAbove()) {
    return true;
  }
  return this->nonMinable;
}
and in step 3 there is no "not minable" attribute set, it is just dynamicaly computed to show that it should not be minable. However clone uses this "effective non minable attribute value" and sets it as "internal non minable value" so result is set permanently - will not be cleared by removing locomotive because locomotive was never intended to set nonMinable attribute internally.

Re: [0.17.49] Removing trains in editor results in not mineable rails

Posted: Mon Jun 17, 2019 10:57 am
by kovarex
boskid wrote:
Sun Jun 16, 2019 9:12 pm
this feels like

Code: Select all

bool Rail::isNonMinable() {
  if(trainAbove()) {
    return true;
  }
  return this->nonMinable;
}
and in step 3 there is no "not minable" attribute set, it is just dynamicaly computed to show that it should not be minable. However clone uses this "effective non minable attribute value" and sets it as "internal non minable value" so result is set permanently - will not be cleared by removing locomotive because locomotive was never intended to set nonMinable attribute internally.
Yes, this is exactly how it was.

Fixed for the next release.

Re: [kovarex] [0.17.49] Removing trains in editor results in not mineable rails

Posted: Mon Jun 17, 2019 3:50 pm
by TxT
Dang thats fast thanks for fixing, glad I could help! :)