Überflüssige ifdef entfernt

This commit is contained in:
Yamagi Burmeister 2009-03-31 15:25:16 +00:00
parent 597a7ca7ec
commit 3cf9b066c6
8 changed files with 1 additions and 243 deletions

View File

@ -252,10 +252,6 @@ qboolean Pickup_Bandolier (edict_t *ent, edict_t *other)
//PMM //PMM
if (other->client->pers.max_flechettes < 250) if (other->client->pers.max_flechettes < 250)
other->client->pers.max_flechettes = 250; other->client->pers.max_flechettes = 250;
#ifndef KILL_DISRUPTOR
if (other->client->pers.max_rounds < 150)
other->client->pers.max_rounds = 150;
#endif
//pmm //pmm
item = FindItem("Bullets"); item = FindItem("Bullets");
@ -302,10 +298,6 @@ qboolean Pickup_Pack (edict_t *ent, edict_t *other)
//PMM //PMM
if (other->client->pers.max_flechettes < 200) if (other->client->pers.max_flechettes < 200)
other->client->pers.max_flechettes = 200; other->client->pers.max_flechettes = 200;
#ifndef KILL_DISRUPTOR
if (other->client->pers.max_rounds < 200)
other->client->pers.max_rounds = 200;
#endif
//pmm //pmm
item = FindItem("Bullets"); item = FindItem("Bullets");
@ -370,17 +362,7 @@ qboolean Pickup_Pack (edict_t *ent, edict_t *other)
if (other->client->pers.inventory[index] > other->client->pers.max_flechettes) if (other->client->pers.inventory[index] > other->client->pers.max_flechettes)
other->client->pers.inventory[index] = other->client->pers.max_flechettes; other->client->pers.inventory[index] = other->client->pers.max_flechettes;
} }
#ifndef KILL_DISRUPTOR //pmm
item = FindItem("Rounds");
if (item)
{
index = ITEM_INDEX(item);
other->client->pers.inventory[index] += item->quantity;
if (other->client->pers.inventory[index] > other->client->pers.max_rounds)
other->client->pers.inventory[index] = other->client->pers.max_rounds;
}
#endif
//pmm
if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value)) if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value))
SetRespawn (ent, ent->item->quantity); SetRespawn (ent, ent->item->quantity);
@ -724,10 +706,6 @@ qboolean Add_Ammo (edict_t *ent, gitem_t *item, int count)
max = ent->client->pers.max_prox; max = ent->client->pers.max_prox;
else if (item->tag == AMMO_TESLA) else if (item->tag == AMMO_TESLA)
max = ent->client->pers.max_tesla; max = ent->client->pers.max_tesla;
#ifndef KILL_DISRUPTOR
else if (item->tag == AMMO_DISRUPTOR)
max = ent->client->pers.max_rounds;
#endif
// ROGUE // ROGUE
else else
{ {
@ -1365,13 +1343,11 @@ be on an entity that hasn't spawned yet.
*/ */
void SpawnItem (edict_t *ent, gitem_t *item) void SpawnItem (edict_t *ent, gitem_t *item)
{ {
#if KILL_DISRUPTOR
if ((!strcmp(ent->classname, "ammo_disruptor")) || (!strcmp(ent->classname, "weapon_disintegrator"))) if ((!strcmp(ent->classname, "ammo_disruptor")) || (!strcmp(ent->classname, "weapon_disintegrator")))
{ {
G_FreeEdict (ent); G_FreeEdict (ent);
return; return;
} }
#endif
if (ent->spawnflags > 1) // PGM if (ent->spawnflags > 1) // PGM
{ {
if (strcmp(ent->classname, "key_power_cube") != 0) if (strcmp(ent->classname, "key_power_cube") != 0)
@ -2035,11 +2011,7 @@ always owned, never in the world
0, // number of digits for statusbar 0, // number of digits for statusbar
1, // amount used / contained 1, // amount used / contained
"Rounds", // ammo type used "Rounds", // ammo type used
#ifdef KILL_DISRUPTOR
IT_NOT_GIVEABLE, IT_NOT_GIVEABLE,
#else
IT_WEAPON, // inventory flags
#endif
WEAP_DISRUPTOR, // visible weapon WEAP_DISRUPTOR, // visible weapon
NULL, // info (void *) NULL, // info (void *)
1, // tag 1, // tag
@ -2278,18 +2250,10 @@ always owned, never in the world
3, 3,
15, 15,
NULL, NULL,
#ifdef KILL_DISRUPTOR
IT_NOT_GIVEABLE, IT_NOT_GIVEABLE,
#else
IT_AMMO, // inventory flags
#endif
0, 0,
NULL, NULL,
#ifdef KILL_DISRUPTOR
0, 0,
#else
AMMO_DISRUPTOR,
#endif
}, },
// ROGUE AMMO // ROGUE AMMO
// ======================================= // =======================================

View File

@ -32,7 +32,6 @@
#define FALL_TIME 0.3 #define FALL_TIME 0.3
// ROGUE- id killed this weapon // ROGUE- id killed this weapon
#define KILL_DISRUPTOR 1
// rogue // rogue
// edict->spawnflags // edict->spawnflags
@ -104,12 +103,7 @@ typedef enum
//ROGUE //ROGUE
AMMO_FLECHETTES, AMMO_FLECHETTES,
AMMO_TESLA, AMMO_TESLA,
#ifdef KILL_DISRUPTOR
AMMO_PROX AMMO_PROX
#else
AMMO_PROX,
AMMO_DISRUPTOR
#endif
} ammo_t; } ammo_t;
@ -1097,9 +1091,7 @@ typedef struct
int max_prox; int max_prox;
int max_mines; int max_mines;
int max_flechettes; int max_flechettes;
#ifndef KILL_DISRUPTOR
int max_rounds; int max_rounds;
#endif
//ROGUE //ROGUE
//========= //=========
} client_persistant_t; } client_persistant_t;

View File

@ -162,11 +162,7 @@ void M_CheckGround (edict_t *ent)
if (ent->flags & (FL_SWIM|FL_FLY)) if (ent->flags & (FL_SWIM|FL_FLY))
return; return;
#ifdef ROGUE_GRAVITY
if ((ent->velocity[2] * ent->gravityVector[2]) < -100) // PGM
#else
if (ent->velocity[2] > 100) if (ent->velocity[2] > 100)
#endif
{ {
ent->groundentity = NULL; ent->groundentity = NULL;
return; return;
@ -175,41 +171,16 @@ void M_CheckGround (edict_t *ent)
// if the hull point one-quarter unit down is solid the entity is on ground // if the hull point one-quarter unit down is solid the entity is on ground
point[0] = ent->s.origin[0]; point[0] = ent->s.origin[0];
point[1] = ent->s.origin[1]; point[1] = ent->s.origin[1];
#ifdef ROGUE_GRAVITY
point[2] = ent->s.origin[2] + (0.25 * ent->gravityVector[2]); //PGM
#else
point[2] = ent->s.origin[2] - 0.25; point[2] = ent->s.origin[2] - 0.25;
#endif
trace = gi.trace (ent->s.origin, ent->mins, ent->maxs, point, ent, MASK_MONSTERSOLID); trace = gi.trace (ent->s.origin, ent->mins, ent->maxs, point, ent, MASK_MONSTERSOLID);
// check steepness // check steepness
#ifdef ROGUE_GRAVITY
//PGM
if ( ent->gravityVector[2] < 0) // normal gravity
{
if ( trace.plane.normal[2] < 0.7 && !trace.startsolid) if ( trace.plane.normal[2] < 0.7 && !trace.startsolid)
{ {
ent->groundentity = NULL; ent->groundentity = NULL;
return; return;
} }
}
else // inverted gravity
{
if ( trace.plane.normal[2] > -0.7 && !trace.startsolid)
{
ent->groundentity = NULL;
return;
}
}
//PGM
#else
if ( trace.plane.normal[2] < 0.7 && !trace.startsolid)
{
ent->groundentity = NULL;
return;
}
#endif
if (!trace.startsolid && !trace.allsolid) if (!trace.startsolid && !trace.allsolid)
{ {
@ -353,26 +324,9 @@ void M_droptofloor (edict_t *ent)
vec3_t end; vec3_t end;
trace_t trace; trace_t trace;
#ifdef ROGUE_GRAVITY
//PGM
if(ent->gravityVector[2] < 0)
{
ent->s.origin[2] += 1; ent->s.origin[2] += 1;
VectorCopy (ent->s.origin, end); VectorCopy (ent->s.origin, end);
end[2] -= 256; end[2] -= 256;
}
else
{
ent->s.origin[2] -= 1;
VectorCopy (ent->s.origin, end);
end[2] += 256;
}
//PGM
#else
ent->s.origin[2] += 1;
VectorCopy (ent->s.origin, end);
end[2] -= 256;
#endif
trace = gi.trace (ent->s.origin, ent->mins, ent->maxs, end, ent, MASK_MONSTERSOLID); trace = gi.trace (ent->s.origin, ent->mins, ent->maxs, end, ent, MASK_MONSTERSOLID);

View File

@ -302,19 +302,7 @@ SV_AddGravity
*/ */
void SV_AddGravity (edict_t *ent) void SV_AddGravity (edict_t *ent)
{ {
#ifdef ROGUE_GRAVITY
if(ent->gravityVector[2] > 0)
{
VectorMA(ent->velocity,
ent->gravity * sv_gravity->value * FRAMETIME,
ent->gravityVector,
ent->velocity);
}
else
ent->velocity[2] -= ent->gravity * sv_gravity->value * FRAMETIME; ent->velocity[2] -= ent->gravity * sv_gravity->value * FRAMETIME;
#else
ent->velocity[2] -= ent->gravity * sv_gravity->value * FRAMETIME;
#endif
} }
/* /*
@ -601,11 +589,6 @@ void SV_Physics_Pusher (edict_t *ent)
// otherwise, just stay in place until the obstacle is gone // otherwise, just stay in place until the obstacle is gone
if (part->blocked) if (part->blocked)
part->blocked (part, obstacle); part->blocked (part, obstacle);
#if 0
// if the pushed entity went away and the pusher is still there
if (!obstacle->inuse && part->inuse)
goto retry;
#endif
} }
else else
{ {

View File

@ -347,14 +347,6 @@ void ED_CallSpawn (edict_t *ent)
return; return;
} }
//PGM - do this before calling the spawn function so it can be overridden.
#ifdef ROGUE_GRAVITY
ent->gravityVector[0] = 0.0;
ent->gravityVector[1] = 0.0;
ent->gravityVector[2] = -1.0;
#endif
//PGM
// FIXME - PMM classnames hack // FIXME - PMM classnames hack
if (!strcmp(ent->classname, "weapon_nailgun")) if (!strcmp(ent->classname, "weapon_nailgun"))
ent->classname = (FindItem("ETF Rifle"))->classname; ent->classname = (FindItem("ETF Rifle"))->classname;
@ -765,13 +757,6 @@ void SpawnEntities (const char *mapname, char *entities, const char *spawnpoint)
ent->spawnflags &= ~(SPAWNFLAG_NOT_EASY|SPAWNFLAG_NOT_MEDIUM|SPAWNFLAG_NOT_HARD|SPAWNFLAG_NOT_COOP|SPAWNFLAG_NOT_DEATHMATCH); ent->spawnflags &= ~(SPAWNFLAG_NOT_EASY|SPAWNFLAG_NOT_MEDIUM|SPAWNFLAG_NOT_HARD|SPAWNFLAG_NOT_COOP|SPAWNFLAG_NOT_DEATHMATCH);
} }
//PGM - do this before calling the spawn function so it can be overridden.
#ifdef ROGUE_GRAVITY
ent->gravityVector[0] = 0.0;
ent->gravityVector[1] = 0.0;
ent->gravityVector[2] = -1.0;
#endif
//PGM
ED_CallSpawn (ent); ED_CallSpawn (ent);
ent->s.renderfx |= RF_IR_VISIBLE; //PGM ent->s.renderfx |= RF_IR_VISIBLE; //PGM
@ -779,16 +764,6 @@ void SpawnEntities (const char *mapname, char *entities, const char *spawnpoint)
gi.dprintf ("%i entities inhibited\n", inhibit); gi.dprintf ("%i entities inhibited\n", inhibit);
#ifdef DEBUG
i = 1;
ent = EDICT_NUM(i);
while (i < globals.num_edicts) {
if (ent->inuse != 0 || ent->inuse != 1)
Com_DPrintf("Invalid entity %d\n", i);
i++, ent++;
}
#endif
G_FindTeams (); G_FindTeams ();
PlayerTrail_Init (); PlayerTrail_Init ();
@ -1368,16 +1343,7 @@ qboolean CheckGroundSpawnPoint (vec3_t origin, vec3_t entMins, vec3_t entMaxs, f
// first, do the easy flat check // first, do the easy flat check
//
#ifdef ROGUE_GRAVITY
// FIXME - this will only handle 0,0,1 and 0,0,-1 gravity vectors
if(gravity > 0)
start[2] = maxs[2] + 1;
else
start[2] = mins[2] - 1; start[2] = mins[2] - 1;
#else
start[2] = mins[2] - 1;
#endif
for (x=0 ; x<=1 ; x++) for (x=0 ; x<=1 ; x++)
{ {
for (y=0 ; y<=1 ; y++) for (y=0 ; y<=1 ; y++)
@ -1406,23 +1372,8 @@ realcheck:
return false; return false;
mid = bottom = tr.endpos[2]; mid = bottom = tr.endpos[2];
#ifdef ROGUE_GRAVITY
if(gravity < 0)
{
start[2] = mins[2];
stop[2] = start[2] - STEPSIZE - STEPSIZE;
mid = bottom = tr.endpos[2] + entMins[2];
}
else
{
start[2] = maxs[2];
stop[2] = start[2] + STEPSIZE + STEPSIZE;
mid = bottom = tr.endpos[2] - entMaxs[2];
}
#else
stop[2] = start[2] - 2*STEPSIZE; stop[2] = start[2] - 2*STEPSIZE;
mid = bottom = tr.endpos[2] + entMins[2]; mid = bottom = tr.endpos[2] + entMins[2];
#endif
for (x=0 ; x<=1 ; x++) for (x=0 ; x<=1 ; x++)
for (y=0 ; y<=1 ; y++) for (y=0 ; y<=1 ; y++)
@ -1440,19 +1391,6 @@ realcheck:
tr = gi.trace (start, vec3_origin, vec3_origin, stop, NULL, MASK_MONSTERSOLID); tr = gi.trace (start, vec3_origin, vec3_origin, stop, NULL, MASK_MONSTERSOLID);
//PGM //PGM
#ifdef ROGUE_GRAVITY
// FIXME - this will only handle 0,0,1 and 0,0,-1 gravity vectors
if(gravity > 0)
{
if (tr.fraction != 1.0 && tr.endpos[2] < bottom)
bottom = tr.endpos[2];
if (tr.fraction == 1.0 || tr.endpos[2] - mid > STEPSIZE)
{
return false;
}
}
else
{
if (tr.fraction != 1.0 && tr.endpos[2] > bottom) if (tr.fraction != 1.0 && tr.endpos[2] > bottom)
bottom = tr.endpos[2]; bottom = tr.endpos[2];
if (tr.fraction == 1.0 || mid - tr.endpos[2] > STEPSIZE) if (tr.fraction == 1.0 || mid - tr.endpos[2] > STEPSIZE)
@ -1460,15 +1398,6 @@ realcheck:
return false; return false;
} }
} }
#else
if (tr.fraction != 1.0 && tr.endpos[2] > bottom)
bottom = tr.endpos[2];
if (tr.fraction == 1.0 || mid - tr.endpos[2] > STEPSIZE)
{
return false;
}
#endif
}
return true; // we can land on it, it's ok return true; // we can land on it, it's ok
} }

View File

@ -525,14 +525,6 @@ void G_InitEdict (edict_t *e)
e->classname = "noclass"; e->classname = "noclass";
e->gravity = 1.0; e->gravity = 1.0;
e->s.number = e - g_edicts; e->s.number = e - g_edicts;
//PGM - do this before calling the spawn function so it can be overridden.
#ifdef ROGUE_GRAVITY
e->gravityVector[0] = 0.0;
e->gravityVector[1] = 0.0;
e->gravityVector[2] = -1.0;
#endif
//PGM
} }
/* /*

View File

@ -34,14 +34,7 @@ qboolean M_CheckBottom (edict_t *ent)
// the corners must be within 16 of the midpoint // the corners must be within 16 of the midpoint
//PGM //PGM
#ifdef ROGUE_GRAVITY
// FIXME - this will only handle 0,0,1 and 0,0,-1 gravity vectors
start[2] = mins[2] - 1; start[2] = mins[2] - 1;
if(ent->gravityVector[2] > 0)
start[2] = maxs[2] + 1;
#else
start[2] = mins[2] - 1;
#endif
//PGM //PGM
for (x=0 ; x<=1 ; x++) for (x=0 ; x<=1 ; x++)
@ -68,20 +61,7 @@ realcheck:
start[1] = stop[1] = (mins[1] + maxs[1])*0.5; start[1] = stop[1] = (mins[1] + maxs[1])*0.5;
//PGM //PGM
#ifdef ROGUE_GRAVITY
if(ent->gravityVector[2] < 0)
{
start[2] = mins[2];
stop[2] = start[2] - STEPSIZE - STEPSIZE;
}
else
{
start[2] = maxs[2];
stop[2] = start[2] + STEPSIZE + STEPSIZE;
}
#else
stop[2] = start[2] - 2*STEPSIZE; stop[2] = start[2] - 2*STEPSIZE;
#endif
//PGM //PGM
trace = gi.trace (start, vec3_origin, vec3_origin, stop, ent, MASK_MONSTERSOLID); trace = gi.trace (start, vec3_origin, vec3_origin, stop, ent, MASK_MONSTERSOLID);
@ -100,28 +80,10 @@ realcheck:
trace = gi.trace (start, vec3_origin, vec3_origin, stop, ent, MASK_MONSTERSOLID); trace = gi.trace (start, vec3_origin, vec3_origin, stop, ent, MASK_MONSTERSOLID);
//PGM //PGM
#ifdef ROGUE_GRAVITY
// FIXME - this will only handle 0,0,1 and 0,0,-1 gravity vectors
if(ent->gravityVector[2] > 0)
{
if (trace.fraction != 1.0 && trace.endpos[2] < bottom)
bottom = trace.endpos[2];
if (trace.fraction == 1.0 || trace.endpos[2] - mid > STEPSIZE)
return false;
}
else
{
if (trace.fraction != 1.0 && trace.endpos[2] > bottom) if (trace.fraction != 1.0 && trace.endpos[2] > bottom)
bottom = trace.endpos[2]; bottom = trace.endpos[2];
if (trace.fraction == 1.0 || mid - trace.endpos[2] > STEPSIZE) if (trace.fraction == 1.0 || mid - trace.endpos[2] > STEPSIZE)
return false; return false;
}
#else
if (trace.fraction != 1.0 && trace.endpos[2] > bottom)
bottom = trace.endpos[2];
if (trace.fraction == 1.0 || mid - trace.endpos[2] > STEPSIZE)
return false;
#endif
//PGM //PGM
} }
@ -329,15 +291,9 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
stepsize = 1; stepsize = 1;
//PGM //PGM
#ifdef ROGUE_GRAVITY
// trace from 1 stepsize gravityUp to 2 stepsize gravityDown.
VectorMA(neworg, -1 * stepsize, ent->gravityVector, neworg);
VectorMA(neworg, 2 * stepsize, ent->gravityVector, end);
#else
neworg[2] += stepsize; neworg[2] += stepsize;
VectorCopy (neworg, end); VectorCopy (neworg, end);
end[2] -= stepsize*2; end[2] -= stepsize*2;
#endif
//PGM //PGM
trace = gi.trace (neworg, ent->mins, ent->maxs, end, ent, MASK_MONSTERSOLID); trace = gi.trace (neworg, ent->mins, ent->maxs, end, ent, MASK_MONSTERSOLID);
@ -358,18 +314,9 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
if (ent->waterlevel == 0) if (ent->waterlevel == 0)
{ {
//PGM //PGM
#ifdef ROGUE_GRAVITY
test[0] = trace.endpos[0];
test[1] = trace.endpos[1];
if(ent->gravityVector[2] > 0)
test[2] = trace.endpos[2] + ent->maxs[2] - 1;
else
test[2] = trace.endpos[2] + ent->mins[2] + 1;
#else
test[0] = trace.endpos[0]; test[0] = trace.endpos[0];
test[1] = trace.endpos[1]; test[1] = trace.endpos[1];
test[2] = trace.endpos[2] + ent->mins[2] + 1; test[2] = trace.endpos[2] + ent->mins[2] + 1;
#endif
//PGM //PGM
contents = gi.pointcontents(test); contents = gi.pointcontents(test);

View File

@ -781,9 +781,6 @@ void InitClientPersistant (gclient_t *client)
client->pers.max_prox = 50; client->pers.max_prox = 50;
client->pers.max_tesla = 50; client->pers.max_tesla = 50;
client->pers.max_flechettes = 200; client->pers.max_flechettes = 200;
#ifndef KILL_DISRUPTOR
client->pers.max_rounds = 100;
#endif
//ROGUE //ROGUE
client->pers.connected = true; client->pers.connected = true;