Пример #1
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;
}
Пример #2
0
int ObjectResetObject()
{
	reset_object(vobjptridx(Cur_object_index));

	Update_flags |= UF_WORLD_CHANGED;

	return 1;
}
Пример #3
0
//	------------------------------------------------------------------------------------------------------
//	Delete current object, if it exists.
//	If it doesn't exist, reformat Matt's hard disk, even if he is in Boston.
int ObjectDelete(void)
{

	if (Cur_object_index != object_none) {
		auto delete_objnum = Cur_object_index;
		ObjectSelectNextinSegment();

		obj_delete(vobjptridx(delete_objnum));

		if (delete_objnum == Cur_object_index)
			Cur_object_index = object_none;

		Update_flags |= UF_WORLD_CHANGED;
	}

	return 1;
}
Пример #4
0
static void move_object_to_vector(const vms_vector &vec_through_screen, fix delta_distance)
{
	const auto &&objp = vobjptridx(Cur_object_index);
	const auto result = vm_vec_scale_add(Viewer->pos, vec_through_screen, vm_vec_dist(Viewer->pos, objp->pos) + delta_distance);
	move_object_to_position(objp, result);
}
Пример #5
0
int ObjectChangeRotation()
{
	return rotate_object(vobjptridx(Cur_object_index), p, b, h);
}