djcev.com

//

Git Repos / fte_dogmode / qc / info / teleport_destination.qc

Last update to this file was on 2024-03-24 at 02:40.

Show teleport_destination.qc

//==============================================================================
// info_teleport_destination, info_teleport_random -- with additions by CEV
//==============================================================================

//======================================================================
// forward declarations
//======================================================================

// info_teleport_destination
entity(entity src, vector org, string tname) spawn_info_teleport_destination;
void(entity e) info_teleport_destination_init;
void() info_teleport_destination;

// info_teleport_random
entity(entity src, vector org) spawn_info_teleport_random;
void(entity e) info_teleport_random_init;
void() info_teleport_random;

//------------------------------------------------------------------------------

/*QUAKED info_teleport_destination (.5 .5 .5) (-8 -8 -8) (8 8 32) X X X X X X X X NOT_ON_EASY NOT_ON_NORMAL NOT_ON_HARD_OR_NIGHTMARE NOT_IN_DEATHMATCH NOT_IN_COOP NOT_IN_SINGLEPLAYER X NOT_ON_HARD_ONLY NOT_ON_NIGHTMARE_ONLY
{
model ("progs/player.mdl");
}
This is the destination marker for a teleporter. It should have a "targetname"
field with the same value as a teleporter's "target" field.
*/

//----------------------------------------------------------------------
// class info_teleport_destination: base_mapentity
// {
//--------------------------------------------------------------
entity(entity src, vector org, string tname)
spawn_info_teleport_destination =
{
local entity e = spawn ();
e.owner = src;
e.origin = org;
e.targetname = tname;
info_teleport_destination_init (e);
return e;
};

//--------------------------------------------------------------
void(entity e) info_teleport_destination_init =
{
base_mapentity_init (e);
e.classname = "info_teleport_destination";
e.classtype = CT_INFO_TELEPORT_DESTINATION;

local vector end;

// this does nothing, just serves as a target spot
e.mangle = e.angles;
e.angles = '0 0 0';
e.model = "";

// drop teleporter exit to the floor if it's PM_TELEDROP units
// away -- CEV
end = e.origin + PM_TELEDROP;
tracebox (e.origin, e.mins, e.maxs, end, FALSE, e);
if (trace_allsolid || trace_startsolid || trace_fraction < 1)
{
droptofloor ();
// bump origin so player won't exit into floor -- CEV
// This was '0 0 24' but that was causing issues -- CEV
e.origin = e.origin + '0 0 27';
}
else
{
// instead apply the standard fixed Z offset -- CEV
e.origin = e.origin + '0 0 27';
}

if (!e.targetname)
if (e.target != __NULL__ && e.target != "")
// quake 3 compat -- CEV
e.targetname = e.target;
else
objerror ("no targetname");
};

//--------------------------------------------------------------
void() info_teleport_destination =
{
// new spawnflags for all entities -- iw
if (SUB_Inhibit())
return;

info_teleport_destination_init (self);
};
// };

/*QUAKED info_teleport_random (.5 .5 .5) (-8 -8 -8) (8 8 32) X X X X X X X X NOT_ON_EASY NOT_ON_NORMAL NOT_ON_HARD_OR_NIGHTMARE NOT_IN_DEATHMATCH NOT_IN_COOP NOT_IN_SINGLEPLAYER X NOT_ON_HARD_ONLY NOT_ON_NIGHTMARE_ONLY
{
model ("progs/player.mdl");
}
This is a random destination marker for a teleporter.
*/

//----------------------------------------------------------------------
// class info_teleport_random: base_mapentity
// {
//--------------------------------------------------------------
entity(entity src, vector org) spawn_info_teleport_random =
{
local entity e = spawn ();
e.owner = src;
e.origin = org;
info_teleport_random_init (e);
return e;
};

//--------------------------------------------------------------
void(entity e) info_teleport_random_init =
{
base_mapentity_init (e);
e.classname = "info_teleport_random";
e.classtype = CT_INFO_TELEPORT_RANDOM;

// this does nothing, just serves as a target spot
e.mangle = e.angles;
e.angles = '0 0 0';
e.model = "";
e.origin = e.origin + '0 0 27';
};

//--------------------------------------------------------------
void() info_teleport_random =
{
// new spawnflags for all entities -- iw
if (SUB_Inhibit())
return;

info_teleport_random_init (self);
};
// };

Return to the top of this page or return to the overview of this repo.

Log teleport_destination.qc

Date Commit Message Author + -
2024-03-24 2nd pass refactor, rework QC class structure cev +79 -26
2024-01-31 Class based monster refactor & start projectiles cev +1 -1
2024-01-09 Continue OO / Class-based refactor cev +17 -12
2023-12-09 Start OO / class-based refactor, work on items cev +79  

Return to the top of this page or return to the overview of this repo.