r4684 - trunk/data/qcsrc/server
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Thu Oct 9 05:28:26 EDT 2008
Author: div0
Date: 2008-10-09 05:28:25 -0400 (Thu, 09 Oct 2008)
New Revision: 4684
Modified:
trunk/data/qcsrc/server/builtins.qh
trunk/data/qcsrc/server/ctf.qc
trunk/data/qcsrc/server/miscfunctions.qc
trunk/data/qcsrc/server/runematch.qc
Log:
defer droptofloor to after all entities are loaded. Fixes issues with q3skoredm1.
Modified: trunk/data/qcsrc/server/builtins.qh
===================================================================
--- trunk/data/qcsrc/server/builtins.qh 2008-10-09 08:54:48 UTC (rev 4683)
+++ trunk/data/qcsrc/server/builtins.qh 2008-10-09 09:28:25 UTC (rev 4684)
@@ -32,7 +32,7 @@
void eprint (entity e) = #31;
float walkmove (float yaw, float dist) = #32;
-float droptofloor () = #34;
+float droptofloor_builtin () = #34;
void lightstyle (float style, string value) = #35;
float rint (float v) = #36;
float floor (float v) = #37;
Modified: trunk/data/qcsrc/server/ctf.qc
===================================================================
--- trunk/data/qcsrc/server/ctf.qc 2008-10-09 08:54:48 UTC (rev 4683)
+++ trunk/data/qcsrc/server/ctf.qc 2008-10-09 09:28:25 UTC (rev 4684)
@@ -51,17 +51,15 @@
self.mangle = self.angles;
self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP;
//self.effects = self.effects | EF_DIMLIGHT;
- if(!self.noalign)
+ if(self.noalign)
{
+ self.dropped_origin = self.origin;
+ }
+ else
+ {
+ droptofloor();
self.movetype = MOVETYPE_TOSS;
- if (!droptofloor())
- {
- dprint("Flag fell out of level at ", vtos(self.origin), "\n");
- remove(self);
- return;
- }
}
- self.oldorigin = self.origin;
};
void LogCTF(string mode, float flagteam, entity actor)
@@ -85,7 +83,7 @@
e.movetype = MOVETYPE_TOSS;
e.solid = SOLID_TRIGGER;
// TODO: play a sound here
- setorigin(e, e.oldorigin);
+ setorigin(e, e.dropped_origin);
e.angles = e.mangle;
e.cnt = FLAG_BASE;
e.owner = world;
@@ -556,8 +554,6 @@
self.effects = self.effects | EF_LOWPRECISION;
if(cvar("g_ctf_fullbrightflags"))
self.effects |= EF_FULLBRIGHT;
- if(!self.noalign)
- droptofloor();
waypoint_spawnforitem(self);
@@ -642,8 +638,6 @@
self.effects = self.effects | EF_LOWPRECISION;
if(cvar("g_ctf_fullbrightflags"))
self.effects |= EF_FULLBRIGHT;
- if(!self.noalign)
- droptofloor();
waypoint_spawnforitem(self);
Modified: trunk/data/qcsrc/server/miscfunctions.qc
===================================================================
--- trunk/data/qcsrc/server/miscfunctions.qc 2008-10-09 08:54:48 UTC (rev 4683)
+++ trunk/data/qcsrc/server/miscfunctions.qc 2008-10-09 09:28:25 UTC (rev 4684)
@@ -1,4 +1,6 @@
void objerror(string s);
+void droptofloor();
+.vector dropped_origin;
void() spawnfunc_info_player_deathmatch; // needed for the other spawnpoints
void() spawnpoint_use;
@@ -1212,6 +1214,7 @@
#define INITPRIO_GAMETYPE_FALLBACK 1
#define INITPRIO_CVARS 5
#define INITPRIO_FINDTARGET 10
+#define INITPRIO_DROPTOFLOOR 20
#define INITPRIO_SETLOCATION 90
#define INITPRIO_LINKDOORS 91
#define INITPRIO_LAST 99
@@ -1538,3 +1541,15 @@
other = o;
activator = a;
}
+
+// deferred dropping
+void DropToFloor_Handler()
+{
+ droptofloor_builtin();
+ self.dropped_origin = self.origin;
+}
+
+void droptofloor()
+{
+ InitializeEntity(self, DropToFloor_Handler, INITPRIO_DROPTOFLOOR);
+}
Modified: trunk/data/qcsrc/server/runematch.qc
===================================================================
--- trunk/data/qcsrc/server/runematch.qc 2008-10-09 08:54:48 UTC (rev 4683)
+++ trunk/data/qcsrc/server/runematch.qc 2008-10-09 09:28:25 UTC (rev 4684)
@@ -39,8 +39,8 @@
return;
}
+ setsize(self, '0 0 -35', '0 0 0');
droptofloor();
- setorigin(self, self.origin + '0 0 35');
}
string RuneName(float r)
More information about the nexuiz-commits
mailing list