// check player inventory at turning points of events. void event_common() { int i, count; object *ob; object where; ob=livings(); i = sizeof(ob); while (i--) { if(!ob[i]||!objectp(ob[i]))continue; where=environment(ob[i]); if(!where||!objectp(where)){ /* write(sprintf("Delete %s(%s) for having no environment.\n",ob[i] ->query("id"),file_name(ob[i]) ) ); */ if(!userp(ob[i]))destruct(ob[i]); else ob[i]->move("/d/city/wumiao.c"); continue; } /* write(sprintf("%s(%s,%s) in %s(%s)\n",ob[i]->query("name"),ob[i]->query( "id"),file_name(ob[i]),where->query("short"),file_name(where) )); */ } ob = users(); // count = 1+random(sizeof(ob)); count = sizeof(ob); i = random(sizeof(ob)); while (count-- > 0) { if( environment(ob[i]) ) UPDATE_D->inventory_check(ob[i]); i = (i+1) % sizeof(ob); } }
void f_livings (void) { push_refed_array(livings()); }
void do_tests() { #ifndef __NO_ADD_ACTION__ ASSERT(!sizeof(filter(livings(), (: !living($1) :)))); if (this_player()) ASSERT(member_array(this_player(), livings()) != -1); #endif }