@@ -144,8 +144,6 @@ using namespace Stg;
144144
145145// static members
146146uint32_t Model::count (0 );
147- uint32_t Model::trail_length (50 );
148- uint64_t Model::trail_interval (5 );
149147std::map<Stg::id_t , Model *> Model::modelsbyid;
150148std::map<std::string, creator_t > Model::name_map;
151149
@@ -238,8 +236,8 @@ Model::Model(World *world, Model *parent, const std::string &type, const std::st
238236 interval_energy((usec_t )1e5), // 100msec
239237 last_update(0 ), log_state(false ), map_resolution(0.1 ), mass(0 ), parent(parent), pose(),
240238 power_pack(NULL ), pps_charging(), rastervis(), rebuild_displaylist(true ), say_string(),
241- stack_children(true ), stall(false ), subs(0 ), thread_safe(false ), trail(trail_length ),
242- trail_index(0 ), type(type), event_queue_num(0 ), used(false ), watts(0.0 ), watts_give(0.0 ),
239+ stack_children(true ), stall(false ), subs(0 ), thread_safe(false ), trail(20 ),
240+ trail_index(0 ), trail_interval( 10 ), type(type), event_queue_num(0 ), used(false ), watts(0.0 ), watts_give(0.0 ),
243241 watts_take(0.0 ), wf(NULL ), wf_entity(0 ), world(world),
244242 world_gui(dynamic_cast <WorldGui *>(world))
245243{
@@ -735,7 +733,7 @@ void Model::UpdateTrail()
735733 item->color = color;
736734
737735 // wrap around ring buffer
738- trail_index %= trail_length ;
736+ trail_index %= trail. size () ;
739737}
740738
741739Model *Model::GetUnsubscribedModelOfType (const std::string &type) const
@@ -1407,9 +1405,8 @@ void Model::Load()
14071405
14081406 Say (wf->ReadString (wf_entity, " say" , " " ));
14091407
1410- trail_length = wf->ReadInt (wf_entity, " trail_length" , trail_length );
1408+ int trail_length = wf->ReadInt (wf_entity, " trail_length" , ( int )trail. size () );
14111409 trail.resize (trail_length);
1412-
14131410 trail_interval = wf->ReadInt (wf_entity, " trail_interval" , trail_interval);
14141411
14151412 this ->alwayson = wf->ReadInt (wf_entity, " alwayson" , alwayson);
0 commit comments