diff --git a/BUGS b/BUGS index 83aa521..30f36e4 100644 --- a/BUGS +++ b/BUGS @@ -4,7 +4,6 @@ - "has_sentry" should be a counter, not a flag (allows a second build if you hack and it gets roasted) - there appears to be a window between when a teamkill curse respawn is disabled and when they're killed. it should be removed. - through some combination of respawning, respawn guard, and teleporters (not necesarily needed), it's possible to get stuck on another person -- if you build your teleporter too close to a wall, and it blows up, you get "tried to sprint to a non-client" - hacked forcefields get you teamkills - the "speed cheat" checker needs to be ripped out, it's kinda useless - sometimes rockets go through armor.. diff --git a/TODO b/TODO index 54836f5..599b0ae 100644 --- a/TODO +++ b/TODO @@ -19,3 +19,4 @@ o "slave teslas" o instead of not allowing two fastest legs when upgraded, restrict the health/armor you're allowed when you have fast legs o make a seperate menu for detonating engineer buildings o remove RPrint, since it's really kinda pointless and just makes the code ugliero change the color defines (eg DARKBLUE) to be the exact number, not number + 1 +o remove the old method for teleports checking if blocked, after confirming it's not needed. (moving platforms block it?) diff --git a/engineer.qc b/engineer.qc index 02cabfb..b56ba7c 100644 --- a/engineer.qc +++ b/engineer.qc @@ -527,8 +527,6 @@ float(entity obj, entity builder) CheckArea = return TRUE; }; - - ////////////////////////////////////////////////////////////////////////// // rehashed version of TF_Build void(float objtobuild) TeamFortress_Build = @@ -695,7 +693,16 @@ void(float objtobuild) TeamFortress_Build = obj.origin = trace_endpos; obj.flags = obj.flags | FL_ONGROUND; - obj.movetype = MOVETYPE_TOSS; + obj.movetype = MOVETYPE_TOSS; + + if (objtobuild == BUILD_TELEPORTER) { + checkmove (obj.origin, '-32 -32 8', '32 32 72', obj.origin - '0 0 128', 0, self); + if (trace_fraction == 1 || trace_allsolid) { + sprint (self, PRINT_HIGH, "Not enough room for teleportation\n"); + dremove (obj); + return; + } + } obj.owner = self; obj.classname = "timer"; @@ -711,6 +718,13 @@ void(float objtobuild) TeamFortress_Build = setsize (obj, mins, maxs); setorigin (obj, obj.origin); + if (objtobuild == BUILD_TELEPORTER) + if (Teleporter_CheckBlocked (obj)) { + sprint (self, PRINT_HIGH, "Not enough room for teleportation.\n"); + dremove (obj); + return; + } + if (objtobuild==BUILD_TESLA) { obj.skin = self.team_no; diff --git a/teleport.qc b/teleport.qc index 5564f5f..461fd22 100644 --- a/teleport.qc +++ b/teleport.qc @@ -10,6 +10,7 @@ Functions for the teleporters void() Teleporter_touch; void() Teleporter_Die; void() Teleporter_heat_think; +integer (entity ent) Teleporter_CheckBlocked; float(entity targ) Teleporter_check_person; #define TELEPORTER_CELLS 8 //How many cells to use on teleport @@ -145,9 +146,6 @@ float(entity targ) Teleporter_check_person = void() Teleporter_heat_think = { //CH used to reduce the heat and check pos - local float pos, num; - local vector loc; - if (self.heat <= 0) self.heat = 0; else @@ -155,33 +153,41 @@ void() Teleporter_heat_think = self.think = Teleporter_heat_think; //keep in loop self.nextthink = time + 1; + if (Teleporter_CheckBlocked(self)) { + sprint (self.real_owner, PRINT_HIGH, "Not enough space for teleportation.\n"); + TF_T_Damage (self, world, world, self.health + 1, 0, 0); + } +}; + +integer (entity ent) Teleporter_CheckBlocked = +{ + local float pos, num; + local vector loc; //CH if spawnflags is >0 do extensive height checks b/c the pad just spawned. - if (self.spawnflags > 0) { - self.spawnflags = self.spawnflags - 1; + if (ent.spawnflags > 0) { + ent.spawnflags = ent.spawnflags - 1; num = 0; //16 checks } else num = 15; //1 check while (num < 16) { - //sprint (self.real_owner, PRINT_HIGH, "Checking space!\n"); - loc = self.origin; - loc_z = loc_z + (rint(random() * 8 + 1) * 8); //1-8 * 8 x+8 -> x+64 + //sprint (ent.real_owner, PRINT_HIGH, "Checking space!\n"); + loc = ent.origin; loc_x = loc_x + ((rint(random() * 3 + 1) * 16) - 32); loc_y = loc_y + ((rint(random() * 3 + 1) * 16) - 32); + loc_z = loc_z + (rint(random() * 8 + 1) * 8); //1-8 * 8 x+8 -> x+64 pos = pointcontents(loc); if (pos == CONTENTS_SOLID || pos == CONTENTS_SKY) - { - TF_T_Damage(self, world, world, self.health+1, 0, 0); - sprint (self.real_owner, PRINT_HIGH, "Not enough space for teleportation.\n"); - num = 100; //Get out of loop - } + return TRUE; num = num + 1; } - + return FALSE; }; + + //================ void() Teleporter_Die = {