Package: darkplaces / 0~20110628+svn11619-3

0022-fix-two-bugs-introduced-in-r11402-that-broke-dm6-tel.patch Patch series | 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
From: LordHavoc <havoc>
Date: Tue, 17 Apr 2012 21:29:58 +0000
Subject: fix two bugs introduced in r11402 that broke dm6 teleporters
 and many other triggers (was using overly padded mins and
 maxs)

Origin: upstream, commit:11796
---
 sv_phys.c |    7 +++++--
 world.c   |    7 +++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/sv_phys.c b/sv_phys.c
index f05cad8..4e7d276 100644
--- a/sv_phys.c
+++ b/sv_phys.c
@@ -723,8 +723,11 @@ int SV_EntitiesInBox(const vec3_t mins, const vec3_t maxs, int maxedicts, prvm_e
 	vec3_t paddedmins, paddedmaxs;
 	if (maxedicts < 1 || resultedicts == NULL)
 		return 0;
-	VectorSet(paddedmins, mins[0] - 10, mins[1] - 10, mins[2] - 1);
-	VectorSet(paddedmaxs, maxs[0] + 10, maxs[1] + 10, maxs[2] + 1);
+	// LordHavoc: discovered this actually causes its own bugs (dm6 teleporters being too close to info_teleport_destination)
+	//VectorSet(paddedmins, mins[0] - 10, mins[1] - 10, mins[2] - 1);
+	//VectorSet(paddedmaxs, maxs[0] + 10, maxs[1] + 10, maxs[2] + 1);
+	VectorCopy(mins, paddedmins);
+	VectorCopy(maxs, paddedmaxs);
 	if (sv_areadebug.integer)
 	{
 		int numresultedicts = 0;
diff --git a/world.c b/world.c
index ffa54d1..87f901b 100644
--- a/world.c
+++ b/world.c
@@ -185,8 +185,11 @@ int World_EntitiesInBox(world_t *world, const vec3_t requestmins, const vec3_t r
 	vec3_t paddedmins, paddedmaxs;
 	int igrid[3], igridmins[3], igridmaxs[3];
 
-	VectorSet(paddedmins, requestmins[0] - 1.0f, requestmins[1] - 1.0f, requestmins[2] - 1.0f);
-	VectorSet(paddedmaxs, requestmaxs[0] + 1.0f, requestmaxs[1] + 1.0f, requestmaxs[2] + 1.0f);
+	// LordHavoc: discovered this actually causes its own bugs (dm6 teleporters being too close to info_teleport_destination)
+	//VectorSet(paddedmins, requestmins[0] - 1.0f, requestmins[1] - 1.0f, requestmins[2] - 1.0f);
+	//VectorSet(paddedmaxs, requestmaxs[0] + 1.0f, requestmaxs[1] + 1.0f, requestmaxs[2] + 1.0f);
+	VectorCopy(requestmins, paddedmins);
+	VectorCopy(requestmaxs, paddedmaxs);
 
 	// FIXME: if areagrid_marknumber wraps, all entities need their
 	// ent->priv.server->areagridmarknumber reset
-- 
1.7.10.4