Ejemplo n.º 1
0
int PlaceHostage()	{
	int ctype,i;
	vms_vector	cur_object_loc;

	//update_due_to_new_segment();
	compute_segment_center(&cur_object_loc, Cursegp);

	ctype = -1;
	for (i=0; i<Num_total_object_types; i++ )	{
		if (ObjType[i] == OL_HOSTAGE )	{
			ctype = i;	
			break;
		}
	}

	Assert( ctype != -1 );

	if (place_object(Cursegp, &cur_object_loc, ctype )==0)	{
		Int3();		// Debug below
		i=place_object(Cursegp, &cur_object_loc, ctype );
		return 1;
	}

	if (hostage_object_is_valid( Cur_object_index ) )	{
		CurrentHostageIndex	= Objects[Cur_object_index].id;
	} else {
		Int3();		// Get John! (Object should be valid)
		i=hostage_object_is_valid( Cur_object_index );	// For debugging only
	}

	return 0;
}
Ejemplo n.º 2
0
static int PlaceHostage()	{
	int ctype,i;
	//update_due_to_new_segment();
	const auto cur_object_loc = compute_segment_center(Cursegp);

	ctype = -1;
	for (i=0; i<Num_total_object_types; i++ )	{
		if (ObjType[i] == OL_HOSTAGE )	{
			ctype = i;	
			break;
		}
	}

	Assert( ctype != -1 );

	if (place_object(Cursegp, cur_object_loc, ctype, 0 )==0)	{
		Int3();		// Debug below
		i=place_object(Cursegp, cur_object_loc, ctype, 0 );
		return 1;
	}

	const auto &&objp = vobjptridx(Cur_object_index);
	if (hostage_object_is_valid(objp))
	{
		CurrentHostageIndex	= get_hostage_id(objp);
	} else {
		Int3();		// Get John! (Object should be valid)
		hostage_object_is_valid(objp);	// For debugging only
	}

	return 0;
}