The International Simutrans Forum

Development => Technical Documentation => Topic started by: jamespetts on March 17, 2012, 02:49:20 PM

Title: Powerlines and public player
Post by: jamespetts on March 17, 2012, 02:49:20 PM
I hope that this is now the right place to put requests for information as to how a particular part of the code works following the forum reorganisation - apologies in advance if I have erred in my posting location.

I am trying to fix a bug in Experimental relating to access rights and power lines, and wonder whether anyone can tell me where in the code provision is made for power lines to connect to public player power lines but not to other players' power lines? In other words, which bit of the code checks whether a potentially connecting power line is public player or not, refuses connexion if it is not, and allows connexion if it is? I should be very grateful for any assistance.
Title: Re: Powerlines and public player
Post by: kierongreen on March 17, 2012, 03:09:33 PM
dings/leitung2.cc:gimme_neighbours(leitung_t **conn)

...
            leitung_t *lt = gr->get_leitung();
            if(  lt  ) {
                const spieler_t *owner = get_besitzer();
                const spieler_t *other = lt->get_besitzer();
                const spieler_t *super = welt->get_spieler(1);
                if (owner==other  ||  owner==super  ||  other==super) {
....
Title: Re: Powerlines and public player
Post by: jamespetts on March 17, 2012, 03:39:38 PM
Thank you - very helpful!