ref: afa5c513017b1d6dccd1dbee33fa79d110d4b19a
dir: /sim.resource.c/
#include <u.h> #include <libc.h> #include <draw.h> #include "dat.h" #include "fns.h" void resourcestate(Mobj *mo) { int os, *t, *te; Resource *r; r = mo->o->res; for(os=OSrich, t=r->thresh, te=t+r->nthresh; t<te; t++, os++) if(mo->amount >= *t) break; mo->state = os; }