File: cmdtest.c

package info (click to toggle)
xshipwars 1.32-5
  • links: PTS
  • area: main
  • in suites: potato
  • size: 17,176 kB
  • ctags: 6,357
  • sloc: ansic: 157,152; makefile: 226; sh: 75
file content (56 lines) | stat: -rw-r--r-- 1,173 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
                       Test function, don't touch!



 */

#include "swserv.h"



int CmdTest(int condescriptor, char *arg)
{
	long con_obj_num, n;
	xsw_object_struct *obj_ptr;

/* Remove this to make the tests work. */
return(0);

	con_obj_num = connection[condescriptor]->object_num;
	if(DBIsObjectGarbage(con_obj_num))
	    return(-1);
	else
	    obj_ptr = xsw_object[con_obj_num];


	n = DBCreateObjectByOPM(
	    "Explosion3",
            NULL,
            XSW_OBJ_TYPE_ANIMATED,
            xsw_object[con_obj_num]->x,
            xsw_object[con_obj_num]->y + 0.2,
            xsw_object[con_obj_num]->z,
            xsw_object[con_obj_num]->heading,
            xsw_object[con_obj_num]->pitch
        );
        if(DBIsObjectGarbage(n))
	    return(-1);
	else
	    obj_ptr = xsw_object[n];

	obj_ptr->sect_x = xsw_object[con_obj_num]->sect_x;
        obj_ptr->sect_y = xsw_object[con_obj_num]->sect_y;
	obj_ptr->sect_z = xsw_object[con_obj_num]->sect_z;

        obj_ptr->animation.total_frames = 6;
        obj_ptr->animation.cycle_times = -1;

	/* Explicitly set imageset. */
	obj_ptr->imageset = 23;

        NetSendCreateObject(-1, n);


        return(0);
}