]> icculus.org git repositories - divverent/nexuiz.git/blob - TeamNexuiz/game/gamec/tfclient.c
Added a Game C folder
[divverent/nexuiz.git] / TeamNexuiz / game / gamec / tfclient.c
1 float intermission_running;                             // This was moved here from mauvebot.c\r
2 float intermission_exittime;                    // This was moved here from g_world.c\r
3 void (entity AD) ParseTFDetect;\r
4 \r
5 entity () FindIntermission =\r
6 {\r
7         local entity spot;\r
8         local float cyc;\r
9 \r
10         spot = find (world, classname, "info_intermission");\r
11         if (spot)\r
12         {\r
13                 cyc = (random () * 1);\r
14                 return (spot);\r
15         }\r
16         spot = find (world, classname, "info_player_start");\r
17         if (spot)\r
18         {\r
19                 return (spot);\r
20         }\r
21         spot = find (world, classname, "info_player_deathmatch");\r
22         if (spot)\r
23         {\r
24                 cyc = (random () * 6);\r
25                 while ((cyc > 1))\r
26                 {\r
27                         spot = find (spot, classname, "info_player_deathmatch");\r
28                         if (!spot)\r
29                         {\r
30                                 spot = find (spot, classname, "info_player_deathmatch");\r
31                         }\r
32                         cyc = (cyc - 1);\r
33                 }\r
34                 return (spot);\r
35         }\r
36         objerror ("FindIntermission: no spot");\r
37 };\r
38 \r
39 void () DecodeLevelParms =\r
40 {\r
41                 if (parems_decoded == 1)\r
42                         return;\r
43 \r
44                 else {\r
45                         local entity decent;\r
46                         decent = find (world, classname, "info_tfdetect");\r
47                         if ((decent != world))\r
48                         {\r
49 //                              teamplay = cvar ("teamplay");\r
50 //                              if ((teamplay == 0))\r
51 //                              {\r
52                                         cvar_set ("teamplay", "21?TeamFortress");\r
53 //                              }\r
54                                 ParseTFDetect (decent);\r
55                                 if (((number_of_teams <= 0.000000) || (number_of_teams >= 5.000000)))\r
56                                 {\r
57                                         number_of_teams = 4.000000;\r
58                                 }\r
59                         }\r
60                 }\r
61                 parems_decoded = 1;\r
62 };\r
63 \r
64 // Execute Change Level\r
65 void () execute_changelevel =\r
66 {\r
67         local entity pos;\r
68 \r
69         intermission_running = 1;\r
70         if (deathmatch)\r
71         {\r
72                 intermission_exittime = (time + 5);\r
73         }\r
74         else\r
75         {\r
76                 intermission_exittime = (time + 2);\r
77         }\r
78         WriteByte (2, 32);\r
79         WriteByte (2, 3);\r
80         WriteByte (2, 3);\r
81         pos = FindIntermission ();\r
82         other = find (world, classname, "player");\r
83         while ((other != world))\r
84         {\r
85                 other.view_ofs = '0 0 0';\r
86                 other.v_angle = pos.mangle;\r
87                 other.angles = pos.mangle;\r
88                 other.fixangle = 1;\r
89                 other.nextthink = (time + 0.5);\r
90                 other.takedamage = 0;\r
91                 other.solid = 0;\r
92                 other.movetype = 0;\r
93                 other.modelindex = 0;\r
94                 setorigin (other, pos.origin);\r
95                 other = find (other, classname, "player");\r
96         }\r
97         WriteByte (2, 30);\r
98 };