@@ -43,12 +43,12 @@ namespace entities
4343
4444 VARF (0 , routeid, -1 , -1 , VAR_MAX, lastroutenode = -1 ; lastroutetime = 0 ; airnodes.setsize(0 )); // selected route in race
4545 VARF (0 , droproute, 0 , 0 , 1 , lastroutenode = -1 ; lastroutetime = 0 ; airnodes.setsize(0 ); if (routeid < 0 ) routeid = 0 );
46- VAR (IDF_HEX, routecolour, 0 , 0xFF22FF , 0xFFFFFF );
4746 VAR (0 , droproutedist, 1 , 16 , VAR_MAX);
4847 VAR (0 , routemaxdist, 0 , 64 , VAR_MAX);
4948 VAR (IDF_PERSIST, showroutenames, 0 , 1 , 1 );
5049 FVAR (IDF_PERSIST, routenameblend, 0 , 1 , 1 );
51- SVARF (IDF_WORLD, routenames, " Easy Medium Hard" , { string s; if (filterstring (s, routenames)) setsvar (" routenames" , s, false ); });
50+ SVARF (IDF_WORLD, routenames, " Easy Medium Hard" , { string s; if (filterstring (s, routenames)) { delete[] routenames; routenames = newstring (s); } });
51+ SVARF (IDF_WORLD, routecolours, " 0x00FF00 0xFF7700 0xFF0000" , { string s; if (filterstring (s, routecolours)) { delete[] routecolours; routecolours = newstring (s); } });
5252
5353 struct rail
5454 {
@@ -3037,7 +3037,16 @@ namespace entities
30373037 {
30383038 if (e.attrs [0 ] != routeid || (!m_edit (game::gamemode) && !m_race (game::gamemode))) break ;
30393039 loopv (e.links ) if (ents.inrange (e.links [i]) && ents[e.links [i]]->type == ROUTE && (!routemaxdist || o.dist (ents[e.links [i]]->o ) <= routemaxdist))
3040- part_flare (o, ents[e.links [i]]->o , 1 , PART_LIGHTNING_FLARE, routecolour);
3040+ {
3041+ int col = 0xFF22FF ;
3042+ char *rcol = indexlist (routecolours, routeid);
3043+ if (rcol)
3044+ {
3045+ if (*rcol) col = parseint (rcol);
3046+ delete[] rcol;
3047+ }
3048+ part_flare (o, ents[e.links [i]]->o , 1 , PART_LIGHTNING_FLARE, col);
3049+ }
30413050
30423051 if (showroutenames && getfirstroute () == idx)
30433052 {
0 commit comments