Scheduled_usecode::Scheduled_usecode ( Usecode_internal *usecode, Usecode_value& oval, Usecode_value& aval ) : objval(oval), arrval(aval), i(0), frame_index(0), no_halt(0) { cnt = arrval.get_array_size(); obj = usecode->get_item(objval); if (!cnt) { arrval = Usecode_value(1, &aval); cnt = 1;
Scheduled_usecode(Usecode_machine *usecode, Usecode_value& oval, Usecode_value& aval) : objval(oval), arrval(aval), i(0), frame_index(0), no_halt(0) { cnt = arrval.get_array_size(); obj = usecode->get_item(objval); objpos = obj ? obj->get_abs_tile_coord() : Tile_coord(-1, -1, -1);  if (!cnt && !arrval.is_array()) cnt = 1; count++; next = first; prev = 0; if (first) first->prev = this; first = this; int opval0 = arrval.get_elem(0).get_int_value(); if (opval0 == 0x23) no_halt = 1;
Scheduled_usecode::Scheduled_usecode	(	Usecode_internal *usecode,	Usecode_value& oval, 	Usecode_value& aval	) : objval(oval), arrval(aval), i(0), frame_index(0), no_halt(0)	{	cnt = arrval.get_array_size();	obj = usecode->get_item(objval);	if (!cnt)			// Not an array??  (This happens.)		{			// Create with single element.		arrval = Usecode_value(1, &aval);		cnt = 1;		}					// Pure kludge for SI wells:	if (objval.get_array_size() == 2 && 	    Game::get_game_type() == SERPENT_ISLE &&	    obj && obj->get_shapenum() == 470 && obj->get_lift() == 0)		{			// We want the TOP of the well.		Usecode_value v2 = objval.get_elem(1);		Game_object *o2 = usecode->get_item(v2);		if (o2->get_shapenum() == obj->get_shapenum() && 		    o2->get_lift() == 2)			{			objval = v2;			obj = o2;			}		}	objpos = obj ? obj->get_abs_tile_coord() : Tile_coord(-1, -1, -1);					// Not an array?	if (!cnt && !arrval.is_array())		cnt = 1;		// Get_elem0 works for non-arrays.	count++;			// Keep track of total.	next = first;			// Put in chain.	prev = 0;	if (first)		first->prev = this;	first = this;	int opval0 = arrval.get_elem0().get_int_value();	if (opval0 == 0x23)		// PURE GUESS:		no_halt = 1;	}