Re: Rivers development
Reply #76 –
Debugging:
the access violation occurs here:
uint8 karte_t::sp2num(spieler_t *sp)
{
if( sp==NULL ) {
return PLAYER_UNOWNED;
}
for(int i=0; i<MAX_PLAYER_COUNT; i++) {
if(spieler[i] == sp) { <<<<<<<<<<<<<<THIS LINE
return i;
}
}
dbg->fatal( "karte_t::sp2num()", "called with an invalid player!" );
}
(The line one on which it occurs is marked). "Sp" is a valid value, but "Speiler" is empty. That is called from void ding_t::set_besitzer(spieler_t *sp), which in turn is called from the line "weg->calc_bild();" in long grund_t::neuen_weg_bauen(weg_t *weg, ribi_t::ribi ribi, spieler_t *sp), which in turn is called from the line "cost = -gr->neuen_weg_bauen(sch, ribi, sp)-besch->get_preis();" in voidwegbauer_t::baue_schiene(), which in turn is called from the line "baue_schiene();" in void wegbauer_t::baue(), which is called by riverbuilder.baue(); in your method.
As to the checkouts and versions - I am currently trying to set up a DVCS for Simutrans-Experimental, so that I can revert the SVN to the default Simutrans to be able to test individual small changes, but I am having considerable trouble making DVCS work at all.