|
|
1.1 ! root 1: # include "trek.h" ! 2: ! 3: /** ! 4: ** schedule damages to device ! 5: **/ ! 6: ! 7: damage(dev, dam) ! 8: int dev; /* device index */ ! 9: float dam; /* time to repair */ ! 10: { ! 11: register int i; ! 12: register EVENT *e; ! 13: register int f; ! 14: ! 15: if (dam <= 0.0) ! 16: return; ! 17: if (Status.cond == DOCKED) ! 18: dam =* Param.dockfac; ! 19: f = Damage[dev]; ! 20: Damage[dev] = 1; ! 21: if (!f) ! 22: { ! 23: schedule(E_FIXDV, dam, 0, 0, dev); ! 24: return; ! 25: } ! 26: for (i = 0; i < MAXEVENTS; i++) ! 27: { ! 28: e = &Event[i]; ! 29: if (e->evcode != E_FIXDV || e->systemname != dev) ! 30: continue; ! 31: reschedule(e, dam); ! 32: return; ! 33: } ! 34: syserr("Cannot find old damages %d\n", dev); ! 35: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.