void Engineer::emergency(Block *block, const string &msg)
{
set_status(msg);
- TrackChain3D *tch3d = new TrackChain3D(layout_3d, *block);
- tch3d->set_color(GL::Color(1.0f, 0.0f, 0.0f));
- tch3d->set_layer(2);
- emergencies.push_back(tch3d);
+ if(block)
+ {
+ TrackChain3D *tch3d = new TrackChain3D(layout_3d, *block);
+ tch3d->set_color(GL::Color(1.0f, 0.0f, 0.0f));
+ tch3d->set_layer(2);
+ emergencies.push_back(tch3d);
+ }
}
void Engineer::halt_event(bool h)