Increased size of filename buffer for entity transition file in missionpack DLL from MAX_QPATH to MAX_OSPATH.

Changed target_changelevel clear inventory check to use MAPTYPE_CUSTOM check instead of != MAPTYPE_ID.
Misc improvements to func_door_secret2.
Partial fix to func_door_secret as a movewith child.
This commit is contained in:
Knightmare66 2020-09-01 20:04:30 -04:00
parent a680872065
commit b91a68376a
8 changed files with 268 additions and 173 deletions

View file

@ -249,6 +249,7 @@ void Move_Begin (edict_t *ent)
Move_Final (ent);
return;
}
// set object's velocity to direction times speed
VectorScale (ent->moveinfo.dir, ent->moveinfo.speed, ent->velocity);
if (ent->movewith && ent->movewith_ent)
@ -315,23 +316,27 @@ void Move_Calc (edict_t *ent, vec3_t dest, void(*func)(edict_t*))
VectorSubtract (dest, ent->s.origin, ent->moveinfo.dir);
ent->moveinfo.remaining_distance = VectorNormalize (ent->moveinfo.dir);
ent->moveinfo.endfunc = func;
// Knightmare- use smart functions for child movement
if (ent->movewith && ent->movewith_ent)
{ // Knightmare- use smart functions for child movement
{
if (VectorCompare(dest, ent->pos0))
Move_pos0_Think(ent);
Move_pos0_Think (ent);
else if (VectorCompare(dest, ent->pos1))
Move_pos1_Think(ent);
Move_pos1_Think (ent);
else if (VectorCompare(dest, ent->pos2))
Move_pos2_Think(ent);
Move_pos2_Think (ent);
else
Move_Begin (ent);
}
else if (ent->moveinfo.speed == ent->moveinfo.accel && ent->moveinfo.speed == ent->moveinfo.decel)
{ // what does this mean?
if (level.current_entity == ((ent->flags & FL_TEAMSLAVE) ? ent->teammaster : ent))
{
if (level.current_entity == ((ent->flags & FL_TEAMSLAVE) ? ent->teammaster : ent)) {
Move_Begin (ent);
else if (ent->movewith)
}
else if (ent->movewith) {
Move_Begin (ent);
}
else // wait 0.1 second to start moving
{
ent->nextthink = level.time + FRAMETIME;
@ -3311,7 +3316,8 @@ void train_move_children (edict_t *self)
// For all but buttons, doors, and plats, move origin and match velocities
if ( strcmp(ent->classname, "func_door") && strcmp(ent->classname, "func_button")
&& strcmp(ent->classname, "func_door_secret") && strcmp(ent->classname, "func_door_secret2")
// && strcmp(ent->classname, "func_door_secret") && strcmp(ent->classname, "func_door_secret2")
&& (ent->class_id != ENTITY_FUNC_DOOR_SECRET) && (ent->class_id != ENTITY_FUNC_DOOR_SECRET2)
&& strcmp(ent->classname, "func_plat") && strcmp(ent->classname, "func_plat2")
&& strcmp(ent->classname, "func_water") && strcmp(ent->classname, "turret_wall")
&& (strcmp(ent->classname, "monster_turret") || !(ent->spawnflags & 128)) )
@ -3451,7 +3457,8 @@ void train_move_children (edict_t *self)
// Special cases:
// Func_door/func_button and trigger fields
if ( !strcmp(ent->classname, "func_door") || !strcmp(ent->classname, "func_button")
|| !strcmp(ent->classname, "func_door_secret") || !strcmp(ent->classname, "func_door_secret2")
// || !strcmp(ent->classname, "func_door_secret") || !strcmp(ent->classname, "func_door_secret2")
|| (ent->class_id == ENTITY_FUNC_DOOR_SECRET) || (ent->class_id == ENTITY_FUNC_DOOR_SECRET2)
|| !strcmp(ent->classname, "func_plat") || !strcmp(ent->classname, "func_plat2")
|| !strcmp(ent->classname, "func_water") || !strcmp(ent->classname, "turret_wall")
|| (!strcmp(ent->classname, "monster_turret") && ent->spawnflags & 128) )
@ -3470,7 +3477,8 @@ void train_move_children (edict_t *self)
VectorMA (ent->pos1, ent->movewith_offset[2], up, ent->pos1);
VectorMA (ent->pos1, 32, eforward, ent->pos2);
}
else if (!strcmp(ent->classname, "func_door_secret"))
// else if (!strcmp(ent->classname, "func_door_secret"))
if (ent->class_id == ENTITY_FUNC_DOOR_SECRET)
{
vec3_t eforward, eright, eup;
@ -3484,7 +3492,8 @@ void train_move_children (edict_t *self)
VectorMA (ent->pos0, ent->side * ent->width, eright, ent->pos1);
VectorMA (ent->pos1, ent->length, eforward, ent->pos2);
}
else if (!strcmp(ent->classname, "func_door_secret2"))
// else if (!strcmp(ent->classname, "func_door_secret2"))
else if (ent->class_id == ENTITY_FUNC_DOOR_SECRET2)
{
vec3_t eforward, eright, eup;
@ -3563,11 +3572,12 @@ void train_move_children (edict_t *self)
{
// Cross fingers here... move bounding boxes of doors and buttons
if ( !strcmp(ent->classname, "func_door") || !strcmp(ent->classname, "func_button")
|| !strcmp(ent->classname, "func_door_secret") || !strcmp(ent->classname, "func_door_secret2")
|| !strcmp(ent->classname, "func_plat") || !strcmp(ent->classname, "func_plat2")
|| !strcmp(ent->classname, "func_water") || (ent->solid == SOLID_TRIGGER)
|| !strcmp(ent->classname, "turret_wall")
|| (!strcmp(ent->classname, "monster_turret") && ent->spawnflags & 128) )
// || !strcmp(ent->classname, "func_door_secret") || !strcmp(ent->classname, "func_door_secret2")
|| (ent->class_id == ENTITY_FUNC_DOOR_SECRET) || (ent->class_id == ENTITY_FUNC_DOOR_SECRET2)
|| !strcmp(ent->classname, "func_plat") || !strcmp(ent->classname, "func_plat2")
|| !strcmp(ent->classname, "func_water") || (ent->solid == SOLID_TRIGGER)
|| !strcmp(ent->classname, "turret_wall")
|| (!strcmp(ent->classname, "monster_turret") && ent->spawnflags & 128) )
{
float ca, sa, yaw;
vec3_t p00, p01, p10, p11;
@ -5034,23 +5044,24 @@ void door_secret_use (edict_t *self, edict_t *other, edict_t *activator)
if ((self->moveinfo.state != STATE_LOWEST) && (self->moveinfo.state != STATE_TOP))
return;
//added sound
// added sound
if (self->moveinfo.sound_start)
gi.sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self->moveinfo.sound_start, 1, self->attenuation, 0); // was ATTN_STATIC
if (self->moveinfo.sound_middle) {
if (self->moveinfo.sound_middle)
{
self->s.sound = self->moveinfo.sound_middle;
#ifdef LOOP_SOUND_ATTENUATION
self->s.attenuation = self->attenuation;
#endif
}
if (self->moveinfo.state == STATE_LOWEST)
{
self->moveinfo.state = STATE_DOWN;
Move_Calc (self, self->pos1, door_secret_move1);
door_use_areaportals (self, true);
}
else //Knightmare added
else // Knightmare added
{
self->moveinfo.state = STATE_UP;
Move_Calc (self, self->pos1, door_secret_move5);
@ -5062,7 +5073,8 @@ void door_secret_move1 (edict_t *self)
self->nextthink = level.time + 1.0;
self->think = door_secret_move2;
self->moveinfo.state = STATE_BOTTOM;
//added sound
// added sound
self->s.sound = 0;
if (self->moveinfo.sound_end)
gi.sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self->moveinfo.sound_end, 1, self->attenuation, 0); // was ATTN_STATIC
@ -5070,7 +5082,7 @@ void door_secret_move1 (edict_t *self)
void door_secret_move2 (edict_t *self)
{
//added sound
// added sound
if (self->moveinfo.sound_start)
gi.sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self->moveinfo.sound_start, 1, self->attenuation, 0); // was ATTN_STATIC
if (self->moveinfo.sound_middle) {
@ -5079,6 +5091,7 @@ void door_secret_move2 (edict_t *self)
self->s.attenuation = self->attenuation;
#endif
}
self->moveinfo.state = STATE_UP;
Move_Calc (self, self->pos2, door_secret_move3);
}
@ -5086,7 +5099,8 @@ void door_secret_move2 (edict_t *self)
void door_secret_move3 (edict_t *self)
{
self->moveinfo.state = STATE_TOP;
//added sound
// added sound
self->s.sound = 0;
if (self->moveinfo.sound_end)
gi.sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self->moveinfo.sound_end, 1, self->attenuation, 0); // was ATTN_STATIC
@ -5100,7 +5114,7 @@ void door_secret_move3 (edict_t *self)
void door_secret_move4 (edict_t *self)
{
//added sound
// added sound
if (self->moveinfo.sound_start)
gi.sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self->moveinfo.sound_start, 1, self->attenuation, 0); // was ATTN_STATIC
if (self->moveinfo.sound_middle) {
@ -5118,7 +5132,8 @@ void door_secret_move5 (edict_t *self)
self->nextthink = level.time + 1.0;
self->think = door_secret_move6;
self->moveinfo.state = STATE_BOTTOM;
//added sound
// added sound
self->s.sound = 0;
if (self->moveinfo.sound_end)
gi.sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self->moveinfo.sound_end, 1, self->attenuation, 0); // was ATTN_STATIC
@ -5126,7 +5141,7 @@ void door_secret_move5 (edict_t *self)
void door_secret_move6 (edict_t *self)
{
//added sound
// added sound
if (self->moveinfo.sound_start)
gi.sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self->moveinfo.sound_start, 1, self->attenuation, 0); // was ATTN_STATIC
if (self->moveinfo.sound_middle) {
@ -5135,6 +5150,7 @@ void door_secret_move6 (edict_t *self)
self->s.attenuation = self->attenuation;
#endif
}
self->moveinfo.state = STATE_DOWN;
Move_Calc (self, self->pos0, door_secret_done);
}
@ -5147,7 +5163,8 @@ void door_secret_done (edict_t *self)
self->takedamage = DAMAGE_YES;
}
self->moveinfo.state = STATE_LOWEST;
//added sound
// added sound
self->s.sound = 0;
if (self->moveinfo.sound_end)
gi.sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self->moveinfo.sound_end, 1, self->attenuation, 0); // was ATTN_STATIC
@ -5160,7 +5177,8 @@ void door_secret_blocked (edict_t *self, edict_t *other)
if (!(other->svflags & SVF_MONSTER) && (!other->client) )
{
// give it a chance to go away on it's own terms (like gibs)
T_Damage (other, self, self, self->pos0, other->s.origin, self->pos0, 100000, 1, 0, MOD_CRUSH);
// T_Damage (other, self, self, self->pos0, other->s.origin, self->pos0, 100000, 1, 0, MOD_CRUSH);
T_Damage (other, self, self, vec3_origin, other->s.origin, vec3_origin, 100000, 1, 0, MOD_CRUSH);
// if it's still there, nuke it
if (other && other->inuse)
BecomeExplosion1 (other);
@ -5178,7 +5196,8 @@ void door_secret_blocked (edict_t *self, edict_t *other)
return;
self->touch_debounce_time = level.time + 0.5;
T_Damage (other, self, self, self->pos0, other->s.origin, self->pos0, self->dmg, 1, 0, MOD_CRUSH);
// T_Damage (other, self, self, self->pos0, other->s.origin, self->pos0, self->dmg, 1, 0, MOD_CRUSH);
T_Damage (other, self, self, vec3_origin, other->s.origin, vec3_origin, self->dmg, 1, 0, MOD_CRUSH);
}
void door_secret_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
@ -5244,7 +5263,7 @@ void SP_func_door_secret (edict_t *ent)
VectorCopy (ent->s.origin, ent->pos0);
AngleVectors (ent->s.angles, forward, right, up);
VectorClear (ent->s.angles);
//ent->side = 1.0 - (ent->spawnflags & SECRET_1ST_LEFT);
// ent->side = 1.0 - (ent->spawnflags & SECRET_1ST_LEFT);
if (ent->spawnflags & SECRET_1ST_LEFT)
ent->side = -1.0;
@ -5277,7 +5296,7 @@ void SP_func_door_secret (edict_t *ent)
ent->touch = door_touch;
}
ent->classname = "func_door";
ent->postthink = train_move_children; //Knightmare- now supports movewith
ent->postthink = train_move_children; // Knightmare- now supports movewith
gi.linkentity (ent);
}

View file

@ -1303,6 +1303,7 @@ void ChasecamStart (edict_t *ent);
#define TRAIN_SPLINE 8192
#define TRAIN_ORIGIN 16384
void door_use_areaportals (edict_t *self, qboolean open);
qboolean box_walkmove (edict_t *ent, float yaw, float dist);
void button_use (edict_t *self, edict_t *other, edict_t *activator);
void trainbutton_use (edict_t *self, edict_t *other, edict_t *activator);

View file

@ -40,18 +40,29 @@ void fd_secret_use (edict_t *self, edict_t *other, edict_t *activator)
if (self->flags & FL_TEAMSLAVE)
return;
// added sound
if (self->moveinfo.sound_start)
gi.sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self->moveinfo.sound_start, 1, self->attenuation, 0); // was ATTN_STATIC
if (self->moveinfo.sound_middle) {
self->s.sound = self->moveinfo.sound_middle;
#ifdef LOOP_SOUND_ATTENUATION
self->s.attenuation = self->attenuation;
#endif
}
// trigger all paired doors
for (ent = self ; ent ; ent = ent->teamchain)
for (ent = self; ent; ent = ent->teamchain)
{
if (self->moveinfo.state == STATE_LOWEST)
{
ent->moveinfo.state = STATE_DOWN;
Move_Calc(ent, ent->pos1, fd_secret_move1);
Move_Calc (ent, ent->pos1, fd_secret_move1);
door_use_areaportals (self, true);
}
else if (self->moveinfo.state == STATE_TOP) //Knightmare added
else if (self->moveinfo.state == STATE_TOP) // Knightmare added
{
self->moveinfo.state = STATE_UP;
Move_Calc(self, self->pos1, fd_secret_move5);
ent->moveinfo.state = STATE_UP;
Move_Calc (ent, ent->pos1, fd_secret_move5);
}
}
}
@ -69,24 +80,39 @@ void fd_secret_killed (edict_t *self, edict_t *inflictor, edict_t *attacker, int
}
// Wait after first movement...
void fd_secret_move1(edict_t *self)
void fd_secret_move1 (edict_t *self)
{
// gi.dprintf("fd_secret_move1\n");
self->nextthink = level.time + 1.0;
self->think = fd_secret_move2;
self->moveinfo.state = STATE_BOTTOM;
// added sound
self->s.sound = 0;
if (self->moveinfo.sound_end)
gi.sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self->moveinfo.sound_end, 1, self->attenuation, 0); // was ATTN_STATIC
}
// Start moving sideways w/sound...
void fd_secret_move2(edict_t *self)
void fd_secret_move2 (edict_t *self)
{
// gi.dprintf("fd_secret_move2\n");
// added sound
if (self->moveinfo.sound_start)
gi.sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self->moveinfo.sound_start, 1, self->attenuation, 0); // was ATTN_STATIC
if (self->moveinfo.sound_middle) {
self->s.sound = self->moveinfo.sound_middle;
#ifdef LOOP_SOUND_ATTENUATION
self->s.attenuation = self->attenuation;
#endif
}
self->moveinfo.state = STATE_UP;
Move_Calc(self, self->pos2, fd_secret_move3);
Move_Calc (self, self->pos2, fd_secret_move3);
}
// Wait here until time to go back...
void fd_secret_move3(edict_t *self)
void fd_secret_move3 (edict_t *self)
{
// gi.dprintf("fd_secret_move3\n");
if (!(self->spawnflags & SEC_OPEN_ONCE))
@ -95,45 +121,82 @@ void fd_secret_move3(edict_t *self)
self->think = fd_secret_move4;
}
self->moveinfo.state = STATE_TOP;
// added sound
self->s.sound = 0;
if (self->moveinfo.sound_end)
gi.sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self->moveinfo.sound_end, 1, self->attenuation, 0); // was ATTN_STATIC
}
// Move backward...
void fd_secret_move4(edict_t *self)
void fd_secret_move4 (edict_t *self)
{
// gi.dprintf("fd_secret_move4\n");
// added sound
if (self->moveinfo.sound_start)
gi.sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self->moveinfo.sound_start, 1, self->attenuation, 0); // was ATTN_STATIC
if (self->moveinfo.sound_middle) {
self->s.sound = self->moveinfo.sound_middle;
#ifdef LOOP_SOUND_ATTENUATION
self->s.attenuation = self->attenuation;
#endif
}
self->moveinfo.state = STATE_UP;
Move_Calc(self, self->pos1, fd_secret_move5);
Move_Calc (self, self->pos1, fd_secret_move5);
}
// Wait 1 second...
void fd_secret_move5(edict_t *self)
void fd_secret_move5 (edict_t *self)
{
// gi.dprintf("fd_secret_move5\n");
self->nextthink = level.time + 1.0;
self->think = fd_secret_move6;
self->moveinfo.state = STATE_BOTTOM;
// added sound
self->s.sound = 0;
if (self->moveinfo.sound_end)
gi.sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self->moveinfo.sound_end, 1, self->attenuation, 0); // was ATTN_STATIC
}
void fd_secret_move6(edict_t *self)
void fd_secret_move6 (edict_t *self)
{
// gi.dprintf("fd_secret_move6\n");
// added sound
if (self->moveinfo.sound_start)
gi.sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self->moveinfo.sound_start, 1, self->attenuation, 0); // was ATTN_STATIC
if (self->moveinfo.sound_middle)
self->s.sound = self->moveinfo.sound_middle;
#ifdef LOOP_SOUND_ATTENUATION
self->s.attenuation = self->attenuation;
#endif
self->moveinfo.state = STATE_DOWN;
Move_Calc(self, self->pos0, fd_secret_done);
Move_Calc (self, self->pos0, fd_secret_done);
}
void fd_secret_done(edict_t *self)
void fd_secret_done (edict_t *self)
{
// gi.dprintf("fd_secret_done\n");
if (!self->targetname || self->spawnflags & SEC_YES_SHOOT)
{
self->health = 1;
// self->health = 1;
self->health = self->max_health;
self->takedamage = DAMAGE_YES;
self->die = fd_secret_killed;
}
self->moveinfo.state = STATE_LOWEST;
// added sound
self->s.sound = 0;
if (self->moveinfo.sound_end)
gi.sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self->moveinfo.sound_end, 1, self->attenuation, 0); // was ATTN_STATIC
door_use_areaportals (self, false);
}
void secret_blocked(edict_t *self, edict_t *other)
void secret_blocked (edict_t *self, edict_t *other)
{
// Remove dead Q1 monsters, as they can't be gibbed
if ( (other->svflags & SVF_DEADMONSTER) && (other->flags & FL_Q1_MONSTER) )
@ -143,7 +206,7 @@ void secret_blocked(edict_t *self, edict_t *other)
}
if (!(self->flags & FL_TEAMSLAVE))
T_Damage (other, self, self, self->pos0, other->s.origin, self->pos0, self->dmg, 0, 0, MOD_CRUSH);
T_Damage (other, self, self, vec3_origin, other->s.origin, vec3_origin, self->dmg, 0, 0, MOD_CRUSH);
// if (time < self->attack_finished)
// return;
@ -158,22 +221,24 @@ secret_touch
Prints messages
================
*/
void secret_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
void secret_touch (edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
{
if (other->health <= 0)
return;
if (!(other->client))
// if (!(other->client))
// Lazarus: Allows robot usage
if (!other->client && !(other->flags & FL_ROBOT))
return;
if (self->monsterinfo.attack_finished > level.time)
return;
self->monsterinfo.attack_finished = level.time + 2;
if (self->message)
{
gi.centerprintf (other, self->message);
gi.sound (other, CHAN_AUTO, gi.soundindex ("misc/talk1.wav"), 1, ATTN_NORM, 0);
// fixme - put this sound back??
// gi.sound (other, CHAN_BODY, "misc/talk.wav", 1, ATTN_NORM);
}
@ -212,12 +277,18 @@ void SP_func_door_secret2 (edict_t *ent)
ent->moveinfo.sound_middle = gi.soundindex (va("doors/dr%02i_mid.wav", ent->sounds));
ent->moveinfo.sound_end = gi.soundindex (va("doors/dr%02i_end.wav", ent->sounds));
}
else
else if (ent->sounds != 1)
{
ent->moveinfo.sound_start = gi.soundindex ("doors/dr1_strt.wav");
ent->moveinfo.sound_middle = gi.soundindex ("doors/dr1_mid.wav");
ent->moveinfo.sound_end = gi.soundindex ("doors/dr1_end.wav");
}
else
{
ent->moveinfo.sound_start = 0;
ent->moveinfo.sound_middle = 0;
ent->moveinfo.sound_end = 0;
}
if (!ent->dmg)
ent->dmg = 2;
@ -234,19 +305,20 @@ void SP_func_door_secret2 (edict_t *ent)
if (ent->move_angles[1] == 0 || ent->move_angles[1] == 180)
{
if (!ent->width)
ent->width = ent->size[1] - 2; //was lrSize
ent->width = ent->size[1] - 2; // was lrSize
if (!ent->length)
ent->length = ent->size[0] - 2; //was fbSize
ent->length = ent->size[0] - 2; // was fbSize
}
else if(ent->move_angles[1] == 90 || ent->move_angles[1] == 270)
else if (ent->move_angles[1] == 90 || ent->move_angles[1] == 270)
{
if (!ent->width)
ent->width = ent->size[0] - 2; //was lrSize
ent->width = ent->size[0] - 2; // was lrSize
if (!ent->length)
ent->length = ent->size[1] - 2; //was fbSize
ent->length = ent->size[1] - 2; // was fbSize
}
else
gi.dprintf("Secret door not at 0,90,180,270!\n");
else {
gi.dprintf("func_door_secret2 angles not set at 0, 90, 180, 270!\n");
}
if (ent->spawnflags & SEC_MOVE_FORWARD)
VectorScale(forward, ent->length, forward);
@ -258,20 +330,21 @@ void SP_func_door_secret2 (edict_t *ent)
else
VectorScale(right, ent->width * -1, right);
if(ent->spawnflags & SEC_1ST_DOWN)
if (ent->spawnflags & SEC_1ST_DOWN)
{
VectorAdd(ent->s.origin, forward, ent->pos1); //was ent->moveinfo.start_origin
VectorAdd(ent->pos1, right, ent->pos2); //was ent->moveinfo.end_origin
VectorAdd(ent->s.origin, forward, ent->pos1); // was ent->moveinfo.start_origin
VectorAdd(ent->pos1, right, ent->pos2); // was ent->moveinfo.end_origin
}
else
{
VectorAdd(ent->s.origin, right, ent->pos1); //was ent->moveinfo.start_origin
VectorAdd(ent->pos1, forward, ent->pos2); //was ent->moveinfo.end_origin
VectorAdd(ent->s.origin, right, ent->pos1); // was ent->moveinfo.start_origin
VectorAdd(ent->pos1, forward, ent->pos2); // was ent->moveinfo.end_origin
}
ent->touch = secret_touch;
ent->blocked = secret_blocked;
ent->use = fd_secret_use;
ent->moveinfo.speed = 50;
ent->moveinfo.accel = 50;
ent->moveinfo.decel = 50;
@ -279,7 +352,9 @@ void SP_func_door_secret2 (edict_t *ent)
if (!ent->targetname || ent->spawnflags & SEC_YES_SHOOT)
{
ent->health = 1;
if (!ent->health) {
ent->health = 1;
}
ent->max_health = ent->health;
ent->takedamage = DAMAGE_YES;
ent->die = fd_secret_killed;
@ -351,7 +426,7 @@ void force_wall_touch (edict_t *self, edict_t *other, cplane_t *plane, csurface_
gi.sound (other, CHAN_AUTO, self->noise_index, 1, ATTN_NORM, 0);
}
T_Damage (other, self, self, self->pos0, other->s.origin, self->pos0, self->dmg, self->dmg, 0, MOD_TRIGGER_HURT);
T_Damage (other, self, self, vec3_origin, other->s.origin, vec3_origin, self->dmg, self->dmg, 0, MOD_TRIGGER_HURT);
}
/*QUAKED func_force_wall (1 0 1) ? START_ON
@ -380,7 +455,7 @@ void SP_func_force_wall(edict_t *ent)
ent->pos1[2] = ent->absmax[2];
ent->pos2[2] = ent->absmax[2];
if(ent->size[0] > ent->size[1])
if (ent->size[0] > ent->size[1])
{
ent->pos1[0] = ent->absmin[0];
ent->pos2[0] = ent->absmax[0];
@ -395,13 +470,13 @@ void SP_func_force_wall(edict_t *ent)
ent->pos2[1] = ent->absmax[1];
}
if(!ent->style)
if (!ent->style)
ent->style = 208;
ent->movetype = MOVETYPE_NONE;
ent->wait = 1;
if(ent->spawnflags & FWALL_START_ON)
if (ent->spawnflags & FWALL_START_ON)
{
ent->solid = SOLID_BSP;
ent->think = force_wall_think;

View file

@ -1125,13 +1125,13 @@ void target_movewith_use (edict_t *self, edict_t *activator, edict_t *other)
{
if (self->spawnflags & 1)
{
if (t->oldmovetype) //restore movetype
if (t->oldmovetype) // restore movetype
t->movetype = t->oldmovetype;
t->movewith_ent = NULL;
t->movewith = NULL;
VectorClear(t->movewith_offset);
t->movewith_set = 0;
if (t->svflags & SVF_MONSTER) //toss monsters up a little bit so they won't be stuck
if (t->svflags & SVF_MONSTER) // toss monsters up a little bit so they won't be stuck
t->s.origin[2] += 2;
}
else if (self->pathtarget)

View file

@ -1512,7 +1512,7 @@ void LoadTransitionEnts (void)
gi.dprintf("==== LoadTransitionEnts ====\n");
if (game.transition_ents)
{
char t_file[MAX_QPATH];
char t_file[MAX_OSPATH];
int i, j;
FILE *f;
vec3_t v_spawn;
@ -1522,10 +1522,10 @@ void LoadTransitionEnts (void)
VectorClear(v_spawn);
if (strlen(game.spawnpoint))
{
spawn = G_Find(NULL,FOFS(targetname),game.spawnpoint);
spawn = G_Find(NULL,FOFS(targetname), game.spawnpoint);
while (spawn)
{
if (!Q_stricmp(spawn->classname,"info_player_start"))
if (!Q_stricmp(spawn->classname, "info_player_start"))
{
VectorCopy(spawn->s.origin,v_spawn);
break;
@ -1536,7 +1536,7 @@ void LoadTransitionEnts (void)
trans_ent_filename (t_file, sizeof(t_file));
f = fopen(t_file,"rb");
if (!f)
gi.error("LoadTransitionEnts: Cannot open %s\n",t_file);
gi.error("LoadTransitionEnts: Cannot open %s\n", t_file);
else
{
for (i=0; i<game.transition_ents; i++)

View file

@ -88,9 +88,9 @@ void Use_Target_Speaker (edict_t *ent, edict_t *other, edict_t *activator)
void SP_target_speaker (edict_t *ent)
{
if(!(ent->spawnflags & 8))
if (!(ent->spawnflags & 8))
{
if(!st.noise)
if (!st.noise)
{
gi.dprintf("target_speaker with no noise set at %s\n", vtos(ent->s.origin));
G_FreeEdict(ent);
@ -288,7 +288,7 @@ void target_explosion_explode (edict_t *self)
self->delay = save;
self->count--;
if(!self->count)
if (!self->count)
{
self->think = G_FreeEdict;
self->nextthink = level.time + 1;
@ -366,7 +366,7 @@ void use_target_changelevel (edict_t *self, edict_t *other, edict_t *activator)
if (activator->client)
{
if(!activator->vehicle)
if (!activator->vehicle)
activator->client->ps.pmove.pm_flags &= ~PMF_NO_PREDICTION;
}
@ -378,7 +378,7 @@ void use_target_changelevel (edict_t *self, edict_t *other, edict_t *activator)
game.lock_revealed = 0;
game.lock_hud = 0;
game.transition_ents = 0;
if(activator->client)
if (activator->client)
{
activator->client->pers.spawn_landmark = false;
activator->client->pers.spawn_levelchange = false;
@ -386,7 +386,7 @@ void use_target_changelevel (edict_t *self, edict_t *other, edict_t *activator)
}
else
{
if(self->spawnflags & 2 && activator->client)
if (self->spawnflags & 2 && activator->client)
{
activator->client->pers.spawn_landmark = true;
VectorSubtract(activator->s.origin,self->s.origin,
@ -396,7 +396,7 @@ void use_target_changelevel (edict_t *self, edict_t *other, edict_t *activator)
activator->client->pers.spawn_angles[ROLL] = 0;
VectorCopy(activator->client->ps.viewangles,activator->client->pers.spawn_viewangles);
activator->client->pers.spawn_pm_flags = activator->client->ps.pmove.pm_flags;
if(self->s.angles[YAW])
if (self->s.angles[YAW])
{
vec3_t angles;
vec3_t forward, right, v;
@ -422,7 +422,7 @@ void use_target_changelevel (edict_t *self, edict_t *other, edict_t *activator)
activator->client->pers.spawn_landmark = false;
}
if((self->spawnflags & 4) && activator->client && !deathmatch->value && !coop->value)
if ((self->spawnflags & 4) && activator->client && !deathmatch->value && !coop->value)
{
nostatus = 1;
stuffcmd(activator,"cl_gun 0;crosshair 0\n");
@ -436,26 +436,26 @@ void use_target_changelevel (edict_t *self, edict_t *other, edict_t *activator)
}
}
if(level.next_skill > 0)
if (level.next_skill > 0)
{
gi.cvar_forceset("skill", va("%d",level.next_skill-1));
level.next_skill = 0; // reset
}
else if(self->spawnflags & 8)
else if (self->spawnflags & 8)
gi.cvar_forceset("skill", "0");
else if(self->spawnflags & 16)
else if (self->spawnflags & 16)
gi.cvar_forceset("skill", "1");
else if(self->spawnflags & 32)
else if (self->spawnflags & 32)
gi.cvar_forceset("skill", "2");
else if(self->spawnflags & 64)
else if (self->spawnflags & 64)
gi.cvar_forceset("skill", "3");
// Knightmare- some of id's stock Q2 maps have this spawnflag
// set on their trigger_changelevels, so exclude those maps
if ( (self->spawnflags & 1) && (level.maptype != MAPTYPE_ID) && (int)allow_clear_inventory->value )
// set on their trigger_changelevels, so only allow this on custom maps
if ( (self->spawnflags & 1) && (level.maptype == MAPTYPE_CUSTOM) && (int)allow_clear_inventory->value )
{
int n;
if(activator && activator->client)
if (activator && activator->client)
{
for (n = 0; n < MAX_ITEMS; n++)
{
@ -476,12 +476,12 @@ void use_target_changelevel (edict_t *self, edict_t *other, edict_t *activator)
}
}
game.transition_ents = 0;
if(self->spawnflags & 2 && activator->client)
if (self->spawnflags & 2 && activator->client)
{
transition = G_Find(NULL,FOFS(classname), "trigger_transition");
while(transition)
while (transition)
{
if(!Q_stricmp(transition->targetname,self->targetname))
if (!Q_stricmp(transition->targetname,self->targetname))
{
game.transition_ents = trigger_transition_ents(self,transition);
if (developer->value)
@ -512,7 +512,7 @@ void SP_target_changelevel (edict_t *ent)
}
// ugly hack because *SOMEBODY* screwed up their map
if((Q_stricmp(level.mapname, "fact1") == 0) && (Q_stricmp(ent->map, "fact3") == 0))
if ((Q_stricmp(level.mapname, "fact1") == 0) && (Q_stricmp(ent->map, "fact3") == 0))
ent->map = "fact3$secret1";
ent->use = use_target_changelevel;
@ -665,9 +665,9 @@ void use_target_blaster (edict_t *self, edict_t *other, edict_t *activator)
self->enemy = NULL;
return;
}
if(self->sounds == 6)
if (self->sounds == 6)
{
if(!AimGrenade (self, start, self->enemy->s.origin, self->speed, movedir))
if (!AimGrenade (self, start, self->enemy->s.origin, self->speed, movedir))
return;
}
else
@ -691,7 +691,7 @@ void use_target_blaster (edict_t *self, edict_t *other, edict_t *activator)
effect = EF_BLASTER;
// Lazarus: weapon choices
if(self->sounds == 1)
if (self->sounds == 1)
{
fire_rail (self, start, movedir, self->dmg, 0);
gi.WriteByte (svc_muzzleflash);
@ -699,22 +699,22 @@ void use_target_blaster (edict_t *self, edict_t *other, edict_t *activator)
gi.WriteByte (MZ_RAILGUN);
gi.multicast (start, MULTICAST_PVS);
}
else if(self->sounds == 2)
else if (self->sounds == 2)
{
fire_rocket(self, start, movedir, self->dmg, self->speed, self->dmg, self->dmg, NULL);
gi.positioned_sound (start, self, CHAN_WEAPON, gi.soundindex("weapons/rocklf1a.wav"), 1, ATTN_NORM, 0);
}
else if(self->sounds == 3)
else if (self->sounds == 3)
{
fire_bfg(self, start, movedir, self->dmg, self->speed, self->dmg);
gi.positioned_sound (start, self, CHAN_WEAPON, gi.soundindex("weapons/laser2.wav"), 1, ATTN_NORM, 0);
}
else if(self->sounds == 4)
else if (self->sounds == 4)
{
fire_rocket(self, start, movedir, self->dmg, self->speed, self->dmg, self->dmg, self->enemy);
gi.positioned_sound (start, self, CHAN_WEAPON, gi.soundindex("weapons/rocklf1a.wav"), 1, ATTN_NORM, 0);
}
else if(self->sounds == 5)
else if (self->sounds == 5)
{
fire_bullet(self, start, movedir, self->dmg, 2, 0, 0, MOD_TARGET_BLASTER);
gi.WriteByte(svc_temp_entity);
@ -723,7 +723,7 @@ void use_target_blaster (edict_t *self, edict_t *other, edict_t *activator)
gi.multicast(start, MULTICAST_PVS);
gi.positioned_sound(start,self,CHAN_WEAPON,gi.soundindex(va("weapons/machgf%db.wav",rand() % 5 + 1)),1,ATTN_NORM,0);
}
else if(self->sounds == 6)
else if (self->sounds == 6)
{
fire_grenade(self, start, movedir, self->dmg, self->speed, 2.5, self->dmg+40, false);
gi.WriteByte (svc_muzzleflash2);
@ -748,7 +748,7 @@ void target_blaster_think (edict_t *self)
vec3_t target;
int i;
if(self->spawnflags & BLASTER_SEEK_PLAYER)
if (self->spawnflags & BLASTER_SEEK_PLAYER)
{
// this takes precedence over everything else
@ -760,9 +760,9 @@ void target_blaster_think (edict_t *self)
// Is currently targeted player alive and not using notarget?
if (self->enemy)
{
if(self->enemy->flags & FL_NOTARGET)
if (self->enemy->flags & FL_NOTARGET)
self->enemy = NULL;
else if(!self->enemy->inuse || self->enemy->health < 0)
else if (!self->enemy->inuse || self->enemy->health < 0)
self->enemy = NULL;
}
@ -772,7 +772,7 @@ void target_blaster_think (edict_t *self)
{
VectorMA(self->enemy->absmin,0.5,self->enemy->size,target);
tr = gi.trace(self->s.origin,vec3_origin,vec3_origin,target,self,MASK_OPAQUE);
if(tr.fraction != 1.0)
if (tr.fraction != 1.0)
self->enemy = NULL;
}
@ -780,25 +780,25 @@ void target_blaster_think (edict_t *self)
if (self->enemy)
{
use_target_blaster(self,self,self);
if(self->wait)
if (self->wait)
self->nextthink = level.time + self->wait;
return;
}
// Find a player - note that we search the entire entity list so we'll
// also hit on func_monitor-viewing fake players
for(i=1, player=g_edicts+1; i<globals.num_edicts && !self->enemy; i++, player++) {
if(!player->inuse) continue;
if(!player->client) continue;
if(player->svflags & SVF_NOCLIENT) continue;
if(player->health >= 0 && !(player->flags & FL_NOTARGET) )
for (i=1, player=g_edicts+1; i<globals.num_edicts && !self->enemy; i++, player++) {
if (!player->inuse) continue;
if (!player->client) continue;
if (player->svflags & SVF_NOCLIENT) continue;
if (player->health >= 0 && !(player->flags & FL_NOTARGET) )
{
if(self->spawnflags & BLASTER_IF_VISIBLE)
if (self->spawnflags & BLASTER_IF_VISIBLE)
{
// player must be seen to shoot
VectorMA(player->s.origin,0.5,player->size,target);
tr = gi.trace(self->s.origin,vec3_origin,vec3_origin,target,self,MASK_OPAQUE);
if(tr.fraction == 1.0)
if (tr.fraction == 1.0)
self->enemy = player;
}
else
@ -812,7 +812,7 @@ void target_blaster_think (edict_t *self)
if (self->enemy)
{
use_target_blaster(self,self,self);
if(self->wait)
if (self->wait)
self->nextthink = level.time + self->wait;
return;
}
@ -828,10 +828,10 @@ void target_blaster_think (edict_t *self)
// have a target, don't care whether it's visible; cannot be a gibbed monster
self->enemy = NULL;
ent = G_Find (NULL, FOFS(targetname), self->target);
while(ent && !self->enemy)
while (ent && !self->enemy)
{
// if target is not a monster, we're done
if( !(ent->svflags & SVF_MONSTER))
if ( !(ent->svflags & SVF_MONSTER))
{
self->enemy = ent;
break;
@ -844,21 +844,21 @@ void target_blaster_think (edict_t *self)
// has a target, but must be visible and not a monster
self->enemy = NULL;
ent = G_Find (NULL, FOFS(targetname), self->target);
while(ent && !self->enemy)
while (ent && !self->enemy)
{
// if the target isn't a monster, we don't care whether
// it can be seen or not.
if( !(ent->svflags & SVF_MONSTER) )
if ( !(ent->svflags & SVF_MONSTER) )
{
self->enemy = ent;
break;
}
if( ent->health > ent->gib_health)
if ( ent->health > ent->gib_health)
{
// Not a gibbed monster
VectorMA(ent->absmin,0.5,ent->size,target);
tr = gi.trace(self->s.origin,vec3_origin,vec3_origin,target,self,MASK_OPAQUE);
if(tr.fraction == 1.0)
if (tr.fraction == 1.0)
{
self->enemy = ent;
break;
@ -868,13 +868,13 @@ void target_blaster_think (edict_t *self)
}
}
}
if(self->enemy || !(self->spawnflags & BLASTER_IF_VISIBLE) )
if (self->enemy || !(self->spawnflags & BLASTER_IF_VISIBLE) )
{
use_target_blaster(self,self,self);
if(self->wait)
if (self->wait)
self->nextthink = level.time + self->wait;
}
else if(self->wait)
else if (self->wait)
self->nextthink = level.time + FRAMETIME;
}
@ -890,7 +890,7 @@ void toggle_target_blaster (edict_t *self, edict_t *other, edict_t *activator)
if (self->spawnflags & 4)
{
self->count--;
if(self->count == 0)
if (self->count == 0)
{
self->think = G_FreeEdict;
self->nextthink = level.time + 1;
@ -910,11 +910,11 @@ void toggle_target_blaster (edict_t *self, edict_t *other, edict_t *activator)
void target_blaster_init (edict_t *self)
{
if(self->target)
if (self->target)
{
edict_t *ent;
ent = G_Find (NULL, FOFS(targetname), self->target);
if(!ent)
if (!ent)
gi.dprintf("%s at %s: %s is a bad target\n", self->classname, vtos(self->s.origin), self->target);
self->enemy = ent;
}
@ -943,15 +943,15 @@ void SP_target_blaster (edict_t *self)
self->use = toggle_target_blaster;
self->enemy = NULL; // for now
self->think = target_blaster_think;
if(self->spawnflags & 4)
if (self->spawnflags & 4)
self->nextthink = level.time + 1;
else
self->nextthink = 0;
}
else if(self->target || (self->spawnflags & BLASTER_SEEK_PLAYER))
else if (self->target || (self->spawnflags & BLASTER_SEEK_PLAYER))
{
self->use = find_target_blaster_target;
if(self->target)
if (self->target)
{
self->think = target_blaster_init;
self->nextthink = level.time + 2*FRAMETIME;
@ -1073,13 +1073,13 @@ void target_laser_ps_think (edict_t *self)
int count;
int i;
if( self->wait > 0) {
if( level.time >= self->starttime )
if ( self->wait > 0) {
if ( level.time >= self->starttime )
{
self->starttime = level.time + self->wait;
self->endtime = level.time + self->delay;
}
else if( level.time >= self->endtime )
else if ( level.time >= self->endtime )
{
self->nextthink = level.time + FRAMETIME;
return;
@ -1092,14 +1092,14 @@ void target_laser_ps_think (edict_t *self)
count = 4;
if (self->enemy) {
if(self->enemy->flags & FL_NOTARGET || (self->enemy->health < self->enemy->gib_health) )
if (self->enemy->flags & FL_NOTARGET || (self->enemy->health < self->enemy->gib_health) )
self->enemy = NULL;
else
{
// first make sure laser can see the center of the enemy
VectorMA(self->enemy->absmin,0.5,self->enemy->size,target);
tr = gi.trace(self->s.origin,vec3_origin,vec3_origin,target,self,MASK_OPAQUE);
if(tr.fraction != 1.0)
if (tr.fraction != 1.0)
self->enemy = NULL;
}
}
@ -1107,16 +1107,16 @@ void target_laser_ps_think (edict_t *self)
{
// find a player - as with target_blaster, search entire entity list so
// we'll pick up fake players representing camera-viewers
for(i=1, player=g_edicts+1; i<globals.num_edicts && !self->enemy; i++, player++)
for (i=1, player=g_edicts+1; i<globals.num_edicts && !self->enemy; i++, player++)
{
if(!player->inuse) continue;
if(!player->client) continue;
if(player->svflags & SVF_NOCLIENT) continue;
if((player->health >= player->gib_health) && !(player->flags & FL_NOTARGET) )
if (!player->inuse) continue;
if (!player->client) continue;
if (player->svflags & SVF_NOCLIENT) continue;
if ((player->health >= player->gib_health) && !(player->flags & FL_NOTARGET) )
{
VectorMA(player->absmin,0.5,player->size,target);
tr = gi.trace(self->s.origin,vec3_origin,vec3_origin,target,self,MASK_OPAQUE);
if(tr.fraction == 1.0) {
if (tr.fraction == 1.0) {
self->enemy = player;
self->spawnflags |= 0x80000001;
count = 8;
@ -1142,7 +1142,7 @@ void target_laser_ps_think (edict_t *self)
ignore = self;
VectorCopy (self->s.origin, start);
VectorMA (start, 2048, self->movedir, end);
while(1)
while (1)
{
tr = gi.trace (start, NULL, NULL, end, ignore, CONTENTS_SOLID|CONTENTS_MONSTER|CONTENTS_DEADMONSTER);
@ -1152,12 +1152,12 @@ void target_laser_ps_think (edict_t *self)
// hurt it if we can
if (tr.ent->takedamage && !self->style)
{
if(!(tr.ent->flags & FL_IMMUNE_LASER) && (self->dmg > 0) )
if (!(tr.ent->flags & FL_IMMUNE_LASER) && (self->dmg > 0) )
T_Damage (tr.ent, self, self->activator, self->movedir, tr.endpos, vec3_origin, self->dmg, 1, DAMAGE_ENERGY, MOD_TARGET_LASER);
else if(self->dmg < 0)
else if (self->dmg < 0)
{
tr.ent->health -= self->dmg;
if(tr.ent->health > tr.ent->max_health)
if (tr.ent->health > tr.ent->max_health)
tr.ent->health = tr.ent->max_health;
}
}
@ -1192,7 +1192,7 @@ void target_laser_ps_on (edict_t *self)
self->activator = self;
self->spawnflags |= 0x80000001;
// self->svflags &= ~SVF_NOCLIENT;
if(self->wait > 0)
if (self->wait > 0)
{
self->starttime = level.time + self->wait;
self->endtime = level.time + self->delay;
@ -1214,7 +1214,7 @@ void target_laser_ps_use (edict_t *self, edict_t *other, edict_t *activator)
{
target_laser_ps_off (self);
self->count--;
if(!self->count)
if (!self->count)
{
self->think = G_FreeEdict;
self->nextthink = level.time + 1;
@ -1236,15 +1236,15 @@ void target_laser_think (edict_t *self)
vec3_t realmin;
// DWH
if( self->wait > 0)
if ( self->wait > 0)
{
// pulsed laser
if( level.time >= self->starttime )
if ( level.time >= self->starttime )
{
self->starttime = level.time + self->wait;
self->endtime = level.time + self->delay;
}
else if( level.time >= self->endtime )
else if ( level.time >= self->endtime )
{
self->nextthink = level.time + FRAMETIME;
return;
@ -1281,11 +1281,11 @@ void target_laser_think (edict_t *self)
// VectorMA (start, 1, self->movedir, start);
VectorMA (start, 2048, self->movedir, end);
while(1)
while (1)
{
//======
// PGM
if(self->spawnflags & LASER_STOPWINDOW)
if (self->spawnflags & LASER_STOPWINDOW)
tr = gi.trace (start, NULL, NULL, end, ignore, MASK_SHOT);
else
tr = gi.trace (start, NULL, NULL, end, ignore, CONTENTS_SOLID|CONTENTS_MONSTER|CONTENTS_DEADMONSTER);
@ -1302,7 +1302,7 @@ void target_laser_think (edict_t *self)
else
{
tr.ent->health -= self->dmg;
if(tr.ent->health > tr.ent->max_health)
if (tr.ent->health > tr.ent->max_health)
tr.ent->health = tr.ent->max_health;
}
}
@ -1337,7 +1337,7 @@ void target_laser_think (edict_t *self)
void target_laser_on (edict_t *self)
{
if(self->wait > 0)
if (self->wait > 0)
{
self->starttime = level.time + self->wait;
self->endtime = level.time + self->delay;
@ -1363,7 +1363,7 @@ void target_laser_use (edict_t *self, edict_t *other, edict_t *activator)
{
target_laser_off (self);
self->count--;
if(!self->count)
if (!self->count)
{
self->think = G_FreeEdict;
self->nextthink = level.time + 1;
@ -1566,7 +1566,7 @@ void old_target_laser_think (edict_t *self)
ignore = self;
VectorCopy (self->s.origin, start);
VectorMA (start, 2048, self->movedir, end);
while(1)
while (1)
{
tr = gi.trace (start, NULL, NULL, end, ignore, CONTENTS_SOLID|CONTENTS_MONSTER|CONTENTS_DEADMONSTER);
@ -1626,7 +1626,7 @@ void target_mal_laser_use (edict_t *self, edict_t *other, edict_t *activator)
{
target_mal_laser_off (self);
self->count--;
if(!self->count)
if (!self->count)
{
self->think = G_FreeEdict;
self->nextthink = level.time + 1;
@ -1726,9 +1726,9 @@ void target_lightramp_think (edict_t *self)
{
char style[2];
if(self->spawnflags & LIGHTRAMP_CUSTOM)
if (self->spawnflags & LIGHTRAMP_CUSTOM)
{
if(self->movedir[2] > 0)
if (self->movedir[2] > 0)
style[0] = self->message[(int)self->movedir[0]];
else
style[0] = self->message[(int)(self->movedir[1]-self->movedir[0])];
@ -1741,15 +1741,15 @@ void target_lightramp_think (edict_t *self)
style[1] = 0;
gi.configstring (CS_LIGHTS+self->enemy->style, style);
if(self->spawnflags & LIGHTRAMP_CUSTOM)
if (self->spawnflags & LIGHTRAMP_CUSTOM)
{
if((self->movedir[0] <= self->movedir[1]) ||
if ((self->movedir[0] <= self->movedir[1]) ||
((self->spawnflags & LIGHTRAMP_LOOP) && (self->spawnflags & LIGHTRAMP_ACTIVE)) ) {
self->nextthink = level.time + FRAMETIME;
if(self->movedir[0] > self->movedir[1])
if (self->movedir[0] > self->movedir[1])
{
self->movedir[0] = 0;
if(self->spawnflags & LIGHTRAMP_TOGGLE)
if (self->spawnflags & LIGHTRAMP_TOGGLE)
self->movedir[2] *= -1;
}
}
@ -1781,7 +1781,7 @@ void target_lightramp_think (edict_t *self)
self->movedir[0] = self->movedir[1];
self->movedir[1] = temp;
self->movedir[2] *= -1;
if( (self->spawnflags & LIGHTRAMP_LOOP) && (self->spawnflags & LIGHTRAMP_ACTIVE) )
if ( (self->spawnflags & LIGHTRAMP_LOOP) && (self->spawnflags & LIGHTRAMP_ACTIVE) )
{
self->timestamp = level.time;
self->nextthink = level.time + FRAMETIME;
@ -1810,7 +1810,7 @@ void target_lightramp_use (edict_t *self, edict_t *other, edict_t *activator)
{
if (self->spawnflags & LIGHTRAMP_LOOP)
{
if(self->spawnflags & LIGHTRAMP_ACTIVE)
if (self->spawnflags & LIGHTRAMP_ACTIVE)
{
self->spawnflags &= ~LIGHTRAMP_ACTIVE; // already on, turn it off
target_lightramp_think(self);
@ -1895,7 +1895,7 @@ void SP_target_lightramp (edict_t *self)
self->use = target_lightramp_use;
self->think = target_lightramp_think;
if(self->spawnflags & LIGHTRAMP_CUSTOM)
if (self->spawnflags & LIGHTRAMP_CUSTOM)
{
self->movedir[0] = 0; // index into message
self->movedir[1] = strlen(self->message)-1; // position of last character
@ -1924,7 +1924,7 @@ void target_earthquake_think (edict_t *self)
int i;
edict_t *e;
if(!(self->spawnflags & 1)) // PGM
if (!(self->spawnflags & 1)) // PGM
{ // PGM
if (self->last_move_time < level.time)
{
@ -1977,7 +1977,7 @@ void target_earthquake_think (edict_t *self)
void target_earthquake_use (edict_t *self, edict_t *other, edict_t *activator)
{
// PGM
// if(g_showlogic && g_showlogic->value)
// if (g_showlogic && g_showlogic->value)
// gi.dprintf("earthquake: %0.1f\n", self->speed);
// PGM
self->timestamp = level.time + self->count;
@ -2005,6 +2005,6 @@ void SP_target_earthquake (edict_t *self)
self->think = target_earthquake_think;
self->use = target_earthquake_use;
if(!(self->spawnflags & 1)) // PGM
if (!(self->spawnflags & 1)) // PGM
self->noise_index = gi.soundindex ("world/quake.wav");
}

View file

@ -1784,7 +1784,7 @@ void trans_ent_filename (char *filename, size_t filenameSize)
int trigger_transition_ents (edict_t *changelevel, edict_t *self)
{
char t_file[MAX_QPATH];
char t_file[MAX_OSPATH];
int i, j;
int total=0;
qboolean nogo;

View file

@ -304,7 +304,7 @@ void Do_Text_Display (edict_t *activator, int flags, char *message)
Com_sprintf(pakfile, sizeof(pakfile), "%s\\pak%d.pak", filename, i);
if (NULL != (f = fopen(pakfile, "rb")))
{
num = fread(&pakheader,1,sizeof(pak_header_t),f);
num = (int)fread(&pakheader, 1, sizeof(pak_header_t), f);
if (num >= sizeof(pak_header_t))
{
if ( pakheader.id[0] == 'P' &&