summaryrefslogtreecommitdiff
path: root/games/quake2-3zb2/files/patch-g_ctf.c
blob: 24fec1266aa4795061a3a2bb3d368b2bb221ca81 (plain) (blame)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
--- ./g_ctf.c.orig	Sat Dec 30 19:09:03 2006
+++ ./g_ctf.c	Sat Dec 30 19:09:23 2006
@@ -378,12 +378,12 @@
 	float	range, range1, range2;
 	char	*cname;
 
-	if (ent->client->resp.ctf_state != CTF_STATE_START)
+	if (ent->client->resp.ctf_state != CTF_STATE_START) {
 		if ( (int)(dmflags->value) & DF_SPAWN_FARTHEST)
 			return SelectFarthestDeathmatchSpawnPoint ();
 		else
 			return SelectRandomDeathmatchSpawnPoint ();
-
+	}
 	ent->client->resp.ctf_state = CTF_STATE_PLAYING;
 
 	switch (ent->client->resp.ctf_team) {
@@ -806,7 +806,7 @@
 		dropped->touch = CTFDropFlagTouch;
 	}
 }
-
+#if 0
 qboolean CTFDrop_Flag(edict_t *ent, gitem_t *item)
 {
 	if (rand() & 1) 
@@ -821,7 +821,21 @@
 	}
 	return false;
 }
-
+#else
+void CTFDrop_Flag(edict_t *ent, gitem_t *item)
+{
+	if (rand() & 1) 
+	{
+		if(!(ent->svflags & SVF_MONSTER))
+		gi.cprintf(ent, PRINT_HIGH, "Only lusers drop flags.\n");
+	}
+	else
+	{
+		if(!(ent->svflags & SVF_MONSTER))
+		gi.cprintf(ent, PRINT_HIGH, "Winners don't drop flags.\n");
+	}
+}
+#endif
 static void CTFFlagThink(edict_t *ent)
 {
 	if (ent->solid != SOLID_NOT)
@@ -3004,10 +3018,11 @@
 	CurrentIndex = 0;
 	memset(Route,0,sizeof(Route));
 	memset(code,0,8);
-
-	if(!ctf->value) sprintf(name,".\\%s\\chdtm\\%s.chn",gamepath->string,level.mapname);
-	else sprintf(name,".\\%s\\chctf\\%s.chf",gamepath->string,level.mapname);
-
+	if(!ctf->value) 
+		sprintf(name,"%s/chdtm/%s.chn",gamepath->string,level.mapname);
+	else 
+		sprintf(name,"%s/chctf/%s.chf",gamepath->string,level.mapname);
+		
 	fpout = fopen(name,"rb");
 	if(fpout == NULL)
 	{
@@ -3224,4 +3239,4 @@
 		if(geti2 != NULL) geti2->client->zc.ctfstate = CTFS_OFFENCER;
 	}
 ///	gi.bprintf(PRINT_HIGH,"Called!!!!\n");
-}
\ No newline at end of file
+}