- add a ALLOW_RCON_ABUSE define, so that stuffing commands to the

clients can be disabled (the default)
- fix teleporter space checking to only check the space a player would
  take up
- add a check so that teslas can't get negative health when hacking.
  (shouldn't happen?!)
- clean up building placement, so that anywhere from 20 below to 30
  above your feet is fair game.  it then checks for solid a second
  time if the top was solid
- add defines for checkmove (SV_Move wrapper)'s type field
  (MOVE_NORMAL, MOVE_NOMONSTER, MOVE_MISSILE)
- add a printtrace function, since I do it so often in debugging.
- BUGS, TODO
This commit is contained in:
Adam Olsen 2001-10-12 06:10:59 +00:00
parent 3d3c7170fc
commit 81f9c7f253
9 changed files with 84 additions and 28 deletions

2
BUGS
View file

@ -21,4 +21,4 @@
- scuba gear doesn't set the rad suit anymore
- I think getting a rad suit clears your scuba gear when it expires
- "hit to disguise to blue, then before it finishes stop disguising, then quick disguise to change your skin.......boop your color will finish disguising, then do another disguise (doesnt matter color/skin) then boop your skin will finish"
- I think the tesla is shorter than it's model because it would hit the model. this needs to be fixed because the tesla can fire while it can't be hit.

8
TODO
View file

@ -13,12 +13,13 @@ X move from *preqcc to cpp
o add more variety to tinkering
o add a way to edit the respawn ammo entities
X add localinfo string for bottom half of the MOTD
o add a define to disable abusive admin commands (eg stuffcmd)
X add a define to disable abusive admin commands (eg stuffcmd)
X the thief skill should set the "invisible" face
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 RPrint, since it's really kinda pointless and just makes the code uglier
o 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?)
o only allow people to use certain topcolors
o allow more variation in skins
@ -29,3 +30,6 @@ o give airborn pipebombs a different death message
o Health should be given automatically based on the amount of money you have left. That'd get rid of the "can't undo health" problem
o Hitting 0 when customizing should give you a confirmation screen, instead of exiting immedietly
o Make 50 frag (upgrade from frags? maybe not) teslas change color or do something special. (not yellow though, as that can happen normally)
o Medikits should trigger buttons
o Fix Sentry movement on platforms. (Make the top the only real entity, and the bottom one purely visual and adjusted to match it's position every frame)

View file

@ -296,10 +296,13 @@ void() Admin_Cmd =
}
else if (st == "gimmedat")
{
#ifdef ALLOW_RCON_ABUSE
sprint(self.admin_kick,PRINT_HIGH,"If you are using this to cheat, you are LAME!\n");
self.admin_kick.money = 99999;
#else
sprint (self, PRINT_HIGH, "Rcon abuse is disabled.\n");
#endif
}
else if (st == "team1" || st == "team2" || st == "team3" || st == "team4")
{
@ -403,6 +406,7 @@ void() Admin_Cmd =
}
else
{
#ifdef ALLOW_RCON_ABUSE
stuffcmd(self.admin_kick,st); // execute command
stuffcmd(self.admin_kick,"\n");
sprint(self,PRINT_HIGH, "Command '");
@ -410,6 +414,9 @@ void() Admin_Cmd =
sprint(self,PRINT_HIGH, "' has been executed for ");
sprint(self, PRINT_HIGH, self.admin_kick.netname);
sprint(self, PRINT_HIGH, "\n");
#else
sprint (self, PRINT_HIGH, "Rcon abuse has been disabled.\n");
#endif
}
}
else

View file

@ -108,3 +108,17 @@ void(entity who) MakeMeDebug =
debug_target=who;
sprint(debug_target,PRINT_HIGH,"(OfteN debug): Server debug messages (dprints) will be sent to you...\n");
};
void (float oneline) printtrace =
{
local string sep = oneline ? " " : "\n";
dprint ("allsolid: " + ftos (trace_allsolid) + sep);
dprint ("startsolid: " + ftos (trace_startsolid) + sep);
dprint ("fraction: " + ftos (trace_fraction) + sep);
dprint ("endpos: " + vtos (trace_endpos) + sep);
dprint ("plane_normal: " + vtos (trace_plane_normal) + sep);
dprint ("plane_dist: " + ftos (trace_plane_dist) + sep);
dprint ("ent: " + (trace_ent ? "yes" : "no") + sep);
dprint ("inopen: " + ftos (trace_inopen) + sep);
dprint ("inwater: " + ftos (trace_inwater) + "\n");
};

View file

@ -34,6 +34,11 @@
#define MOVETYPE_BOUNCE 10
#define MOVETYPE_BOUNCEMISSILE 11 // bounce with extra size
// checkmove types
#define MOVE_NORMAL 0
#define MOVE_NOMONSTERS 1
#define MOVE_MISSILE 2
// edict.solid values
#define SOLID_NOT 0 // no interaction with other objects
#define SOLID_TRIGGER 1 // touch on edge, but not blocking

View file

@ -532,7 +532,6 @@ float(entity obj, entity builder) CheckArea =
void(float objtobuild) TeamFortress_Build =
{
local float btime;
local vector mins, maxs;
local entity obj;
obj = spawn();
@ -568,8 +567,8 @@ void(float objtobuild) TeamFortress_Build =
sprint(self, PRINT_HIGH, "You must buy the dispenser before you can build it.\n");
return;
}
mins = '-8 -8 0';
maxs = '8 8 24';
obj.mins = '-8 -8 0';
obj.maxs = '8 8 24';
#ifdef no_new_dispenser
obj.mdl = "progs/disp.mdl";
@ -594,8 +593,8 @@ void(float objtobuild) TeamFortress_Build =
return;
}
mins = '-16 -16 0';
maxs = '16 16 48';
obj.mins = '-16 -16 0';
obj.maxs = '16 16 48';
//obj.mdl = "progs/turrbase.mdl";
obj.mdl = "progs/trrbs2.mdl";
obj.netname = "sentrygun";
@ -615,10 +614,10 @@ void(float objtobuild) TeamFortress_Build =
return;
}
// mins = '-16 -16 0'; //- OfN commented by
mins = '-16 -16 -25';
// maxs = '16 16 48'; //WK 62 is better, but crashes?
maxs = '16 16 23';
// obj.mins = '-16 -16 0'; //- OfN commented by
obj.mins = '-16 -16 -25';
// obj.maxs = '16 16 48'; //WK 62 is better, but crashes?
obj.maxs = '16 16 23';
//obj.mdl = "progs/newtesla.mdl";
obj.mdl = "progs/coil.mdl";
obj.netname = "tesla";
@ -654,8 +653,8 @@ void(float objtobuild) TeamFortress_Build =
return;
}
mins = '-16 -16 0';
maxs = '16 16 4';
obj.mins = '-16 -16 0';
obj.maxs = '16 16 4';
obj.mdl = "progs/telepad.mdl";
obj.netname = "teleporter";
@ -674,8 +673,8 @@ void(float objtobuild) TeamFortress_Build =
return;
}
mins = '-6 -6 0';
maxs = '6 6 54';
obj.mins = '-6 -6 0';
obj.maxs = '6 6 54';
obj.mdl = "progs/ffgen2.mdl";
obj.netname = "field generator";
@ -684,11 +683,22 @@ void(float objtobuild) TeamFortress_Build =
if (objtobuild != BUILD_SECURITY_CAMERA)
{
checkmove(obj.origin + '0 0 8', mins, maxs, obj.origin - '0 0 64', 0, self);
local vector startpos, endpos;
startpos = obj.origin;
startpos_z = self.absmin_z - obj.mins_z + 30;
endpos = obj.origin;
endpos_z = self.absmin_z - obj.mins_z - 20;
checkmove(startpos, obj.mins, obj.maxs, endpos, MOVE_NORMAL, self);
if (trace_startsolid || trace_fraction == 1) {
sprint(self, PRINT_HIGH, "Not enough room to build here\n");
dremove(obj);
return;
checkmove (trace_endpos, obj.mins, obj.maxs, trace_endpos,
MOVE_NORMAL, self);
printtrace (TRUE);
if (trace_startsolid) {
sprint(self, PRINT_HIGH, "Not enough room to build here\n");
dremove(obj);
return;
}
}
obj.origin = trace_endpos;
@ -696,8 +706,9 @@ void(float objtobuild) TeamFortress_Build =
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_startsolid || trace_fraction == 1) {
checkmove (obj.origin + '0 0 32', '-16 -16 -24', '16 16 32',
obj.origin + '0 0 30', MOVE_NOMONSTERS, self);
if (trace_startsolid || trace_fraction != 1) {
sprint (self, PRINT_HIGH, "Not enough room for teleportation\n");
dremove (obj);
return;
@ -715,12 +726,13 @@ void(float objtobuild) TeamFortress_Build =
obj.solid = SOLID_BBOX;
setmodel (obj, obj.mdl);
setsize (obj, mins, maxs);
setsize (obj, obj.mins, obj.maxs);
setorigin (obj, obj.origin);
if (objtobuild == BUILD_TELEPORTER)
if (Teleporter_CheckBlocked (obj)) {
sprint (self, PRINT_HIGH, "Not enough room for teleportation.\n");
sprint (self, PRINT_HIGH, "Not enough room for " +
"teleportation.\n");
dremove (obj);
return;
}

View file

@ -728,9 +728,11 @@ void() SBFireInterface =
local float num;
num=targ.health/targ.max_health;
targ.max_health=targ.max_health*2;
targ.health=num*targ.max_health;
num = targ.health / targ.max_health;
if (num < 0) // this shouldn't happen, but I got a report that it did
num = 0;
targ.max_health = targ.max_health * 2;
targ.health = num * targ.max_health;
}
else if (hackThis == IMPROVED_SEVEN)

View file

@ -14,6 +14,8 @@
//#define MAD_MONSTERS // for testing
//#define MAD_TESLA // for testing
//#define ALLOW_RCON_ABUSE // lets them stuff commands to the players
//#define GRUNTY_EXTRA_WEAPONS WEAP_ROCKET_LAUNCHER | WEAP_SUPER_SHOTGUN // 0
//--- additional global defines ----------------------//

View file

@ -161,6 +161,15 @@ void() Teleporter_heat_think =
integer (entity ent) Teleporter_CheckBlocked =
{
checkmove (ent.origin + '0 0 32', '-16 -16 -24', '16 16 32',
ent.origin + '0 0 32', MOVE_NOMONSTERS, ent);
if (trace_startsolid || trace_fraction != 1)
return TRUE;
else
return FALSE;
/*
local float pos, num;
local vector loc;
@ -185,6 +194,7 @@ integer (entity ent) Teleporter_CheckBlocked =
num = num + 1;
}
return FALSE;
*/
};