From: Mario Date: Fri, 3 Apr 2015 20:13:40 +0000 (+1100) Subject: Attempting a fix for funky ladders X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=891c6d96527c8d4cddc3406208b72d599005817c;p=xonotic%2Fxonotic-data.pk3dir.git Attempting a fix for funky ladders --- diff --git a/qcsrc/client/progs.src b/qcsrc/client/progs.src index e86190134..b158af4f5 100644 --- a/qcsrc/client/progs.src +++ b/qcsrc/client/progs.src @@ -90,3 +90,4 @@ weapons/projectile.qc // TODO ../warpzonelib/client.qc ../warpzonelib/common.qc ../warpzonelib/mathlib.qc +../warpzonelib/util_server.qc diff --git a/qcsrc/common/triggers/func/ladder.qc b/qcsrc/common/triggers/func/ladder.qc index 762d1ef70..c24e696c6 100644 --- a/qcsrc/common/triggers/func/ladder.qc +++ b/qcsrc/common/triggers/func/ladder.qc @@ -25,6 +25,7 @@ float func_ladder_send(entity to, float sf) WriteString(MSG_ENTITY, self.classname); WriteByte(MSG_ENTITY, self.skin); WriteByte(MSG_ENTITY, self.speed); + WriteString(MSG_ENTITY, self.mdl); trigger_common_write(false); @@ -33,11 +34,14 @@ float func_ladder_send(entity to, float sf) void func_ladder_link() { - //Net_LinkEntity(self, false, 0, func_ladder_send); + self.SendEntity = func_ladder_send; + self.SendFlags = 0xFFFFFF; + self.model = "null"; } void spawnfunc_func_ladder() { + self.mdl = self.model; EXACTTRIGGER_INIT; self.touch = func_ladder_touch; @@ -46,6 +50,7 @@ void spawnfunc_func_ladder() void spawnfunc_func_water() { + self.mdl = self.model; EXACTTRIGGER_INIT; self.touch = func_ladder_touch; @@ -60,8 +65,10 @@ void ent_func_ladder() self.classname = strzone(ReadString()); self.skin = ReadByte(); self.speed = ReadByte(); + self.model = strzone(ReadString()); trigger_common_read(false); + self.mins = self.maxs = '0 0 0'; self.solid = SOLID_TRIGGER; self.draw = trigger_draw_generic; @@ -69,5 +76,8 @@ void ent_func_ladder() self.drawmask = MASK_NORMAL; self.move_time = time; self.entremove = trigger_remove_generic; + + //precache_model(self.mdl); + EXACTTRIGGER_INIT; } #endif diff --git a/qcsrc/common/triggers/triggers.qh b/qcsrc/common/triggers/triggers.qh index 8dd7618d3..f4035dc5f 100644 --- a/qcsrc/common/triggers/triggers.qh +++ b/qcsrc/common/triggers/triggers.qh @@ -47,9 +47,6 @@ void SUB_UseTargets_PreventReuse(); void trigger_common_read(bool withtarget); void trigger_remove_generic(); -float WarpZoneLib_ExactTrigger_Touch(); -#define EXACTTRIGGER_TOUCH if(WarpZoneLib_ExactTrigger_Touch()) return - .float active; .string target; .string targetname; diff --git a/qcsrc/server/miscfunctions.qh b/qcsrc/server/miscfunctions.qh index 272762be3..f38c86e5e 100644 --- a/qcsrc/server/miscfunctions.qh +++ b/qcsrc/server/miscfunctions.qh @@ -409,10 +409,6 @@ const float SND_ATTENUATION = 2; const float SND_LARGEENTITY = 8; const float SND_LARGESOUND = 16; -// WARNING: this kills the trace globals -#define EXACTTRIGGER_TOUCH if(WarpZoneLib_ExactTrigger_Touch()) return -#define EXACTTRIGGER_INIT WarpZoneLib_ExactTrigger_Init() - const float INITPRIO_FIRST = 0; const float INITPRIO_GAMETYPE = 0; const float INITPRIO_GAMETYPE_FALLBACK = 1; diff --git a/qcsrc/warpzonelib/common.qh b/qcsrc/warpzonelib/common.qh index 76a77ab02..3e2b7c7c6 100644 --- a/qcsrc/warpzonelib/common.qh +++ b/qcsrc/warpzonelib/common.qh @@ -106,4 +106,11 @@ entity WarpZone_RefSys_SpawnSameRefSys(entity me); // spawn().R = me.R #endif float WarpZoneLib_MoveOutOfSolid(entity e); #define move_out_of_solid(e) WarpZoneLib_MoveOutOfSolid(e) + +float WarpZoneLib_ExactTrigger_Touch(); +void WarpZoneLib_ExactTrigger_Init(); + +// WARNING: this kills the trace globals +#define EXACTTRIGGER_TOUCH if(WarpZoneLib_ExactTrigger_Touch()) return +#define EXACTTRIGGER_INIT WarpZoneLib_ExactTrigger_Init() #endif diff --git a/qcsrc/warpzonelib/util_server.qc b/qcsrc/warpzonelib/util_server.qc index 06ca72a68..36562541e 100644 --- a/qcsrc/warpzonelib/util_server.qc +++ b/qcsrc/warpzonelib/util_server.qc @@ -26,7 +26,9 @@ void WarpZoneLib_ExactTrigger_Init() { mi = self.mins; ma = self.maxs; +#ifdef SVQC precache_model(self.model); +#endif setmodel(self, self.model); // let mapper-set mins/maxs override the model's bounds if set if(mi != '0 0 0' || ma != '0 0 0')