Compare commits
12 Commits
649ed825ad
...
32a36d8017
Author | SHA1 | Date |
---|---|---|
Marco Cawthorne | 32a36d8017 | |
Marco Cawthorne | f0034cb03a | |
Marco Cawthorne | 9c66c2c5f9 | |
Marco Cawthorne | c0b031ed9f | |
Marco Cawthorne | e2239a236f | |
Marco Cawthorne | 50cc1b6198 | |
Marco Cawthorne | 6c8b56c39f | |
Marco Cawthorne | 57b19425c1 | |
Marco Cawthorne | 37ab385bcf | |
Marco Cawthorne | 0f96e635b0 | |
Marco Cawthorne | 86cfec6e6d | |
Marco Cawthorne | d405ff7e90 |
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
diffusemap textures/editor/info_node.tga
|
||||
|
||||
{
|
||||
map $diffuse
|
||||
blendFunc blend
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
diffusemap textures/editor/info_node_air.tga
|
||||
|
||||
{
|
||||
map $diffuse
|
||||
blendFunc blend
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
diffusemap textures/editor/light_dynamic.tga
|
||||
|
||||
{
|
||||
map $diffuse
|
||||
blendFunc blend
|
||||
rgbGen vertex
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
diffusemap textures/editor/model_bone.tga
|
||||
|
||||
{
|
||||
map $diffuse
|
||||
blendFunc blend
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
diffusemap textures/editor/path_track.tga
|
||||
|
||||
{
|
||||
map $diffuse
|
||||
blendFunc blend
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
diffusemap textures/editor/scripted_sequence.tga
|
||||
|
||||
{
|
||||
map $diffuse
|
||||
blendFunc blend
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -617,6 +617,12 @@ Way_DrawDebugInfo(void)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
Way_LoadCurrentMapNavMesh(void)
|
||||
{
|
||||
Way_ReadFile(sprintf("%s.way", mapname), true);
|
||||
}
|
||||
|
||||
void Way_ReadFBFile(string, bool);
|
||||
void Way_ReadPBFile(string, bool);
|
||||
void Way_ReadJumbotFile(string, bool);
|
||||
|
|
|
@ -75,7 +75,7 @@ var bool g_cheats = false;
|
|||
|
||||
#define READENTITY_ANGLE(field, changedflag) {\
|
||||
if (flChanged & changedflag) {\
|
||||
field = readshort() / (32767 / 360);\
|
||||
field = readangle();\
|
||||
PRINTFLAG(changedflag); \
|
||||
}\
|
||||
}
|
||||
|
|
|
@ -170,6 +170,10 @@ env_explosion::Trigger(entity act, triggermode_t state)
|
|||
{
|
||||
bool shouldDamage = true;
|
||||
|
||||
if (m_bEnabled == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (HasSpawnFlags(ENVEXPLO_NOTUNDERWATER) == true && WaterLevel() > 0) {
|
||||
shouldDamage = false;
|
||||
} else if (HasSpawnFlags(ENVEXPLO_NODAMAGE) == true) {
|
||||
|
|
|
@ -416,16 +416,23 @@ func_door::MoverFinishesMoving(void)
|
|||
MoveToPosition(GetMoverPosition1(), m_flSpeed);
|
||||
}
|
||||
|
||||
/* we arrived at our starting position within the map */
|
||||
if (GetMoverState() == MOVER_POS1) {
|
||||
if (targetClose)
|
||||
for (entity f = world; (f = find(f, ::targetname, targetClose));) {
|
||||
NSEntity trigger = (NSEntity)f;
|
||||
if (trigger.Trigger != __NULL__) {
|
||||
trigger.Trigger(this, TRIG_TOGGLE);
|
||||
|
||||
if (targetClose && targetClose != "") {
|
||||
/* when it starts open the positions are reversed... */
|
||||
if (GetMoverState() == MOVER_POS1 ||
|
||||
(HasSpawnFlags(SF_MOV_OPEN) && GetMoverState() == MOVER_POS2)) {
|
||||
for (entity f = world; (f = find(f, ::targetname, targetClose));) {
|
||||
NSEntity trigger = (NSEntity)f;
|
||||
if (trigger.Trigger != __NULL__) {
|
||||
trigger.Trigger(this, TRIG_TOGGLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* we arrived at our starting position within the map */
|
||||
if (GetMoverState() == MOVER_POS1) {
|
||||
if (m_strSndStop) {
|
||||
StartSoundDef(m_strSndStop, CHAN_VOICE, true);
|
||||
} else {
|
||||
|
|
|
@ -196,6 +196,8 @@ light::Spawned(void)
|
|||
void
|
||||
light::Respawn(void)
|
||||
{
|
||||
InitPointTrigger();
|
||||
|
||||
switch (serverkeyfloat("*bspversion")) {
|
||||
case BSPVER_PREREL:
|
||||
case BSPVER_Q1:
|
||||
|
|
|
@ -83,7 +83,7 @@ path_corner::path_corner(void)
|
|||
m_iFired = 0i;
|
||||
m_flSpeed = 0.0f;
|
||||
m_flYawSpeed = 0.0f;
|
||||
m_flWait = 1.0f;
|
||||
m_flWait = 0.0f;
|
||||
m_strOnPass = __NULL__;
|
||||
}
|
||||
|
||||
|
@ -232,9 +232,13 @@ path_corner::PathPassTrigger(entity activatingEntity, triggermode_t triggerMode)
|
|||
return;
|
||||
}
|
||||
|
||||
EntLog("%S (%d) has passed us.", \
|
||||
activatingEntity.classname, num_for_edict(activatingEntity));
|
||||
|
||||
UseOutput(this, m_strOnPass);
|
||||
|
||||
if (!m_strMessage)
|
||||
/* never trigger "" */
|
||||
if (!m_strMessage || m_strMessage == "")
|
||||
return;
|
||||
|
||||
for (entity f = world; (f = find(f, ::targetname, m_strMessage));) {
|
||||
|
|
|
@ -61,6 +61,7 @@ public:
|
|||
nonvirtual void PathEndTrigger(entity, triggermode_t);
|
||||
|
||||
/* overrides */
|
||||
virtual void DebugDraw(void);
|
||||
virtual void Respawn(void);
|
||||
virtual void SpawnKey(string, string);
|
||||
virtual void Save(float);
|
||||
|
@ -89,6 +90,25 @@ path_track::path_track(void)
|
|||
m_strEndTrigger = __NULL__;
|
||||
}
|
||||
|
||||
void
|
||||
path_track::DebugDraw(void)
|
||||
{
|
||||
vector pos = GetOrigin();
|
||||
pos[2] += 32;
|
||||
R_BeginPolygon("textures/editor/path_track", 0, 0);
|
||||
R_PolygonVertex(pos + v_right * 24 - v_up * 24, [1,1], [1,1,1], 1.0f);
|
||||
R_PolygonVertex(pos - v_right * 24 - v_up * 24, [0,1], [1,1,1], 1.0f);
|
||||
R_PolygonVertex(pos - v_right * 24 + v_up * 24, [0,0], [1,1,1], 1.0f);
|
||||
R_PolygonVertex(pos + v_right * 24 + v_up * 24, [1,0], [1,1,1], 1.0f);
|
||||
R_EndPolygon();
|
||||
|
||||
R_BeginPolygon("", 0, 0);
|
||||
R_PolygonVertex(GetOrigin(), [0,1], [1,1,1], 0.5f);
|
||||
R_PolygonVertex(pos, [1,1], [1,1,1], 0.5f);
|
||||
R_EndPolygon();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
path_track::SpawnKey(string keyName, string setValue)
|
||||
{
|
||||
|
@ -212,7 +232,7 @@ path_track::GetPathTarget(void)
|
|||
return targetname;
|
||||
}
|
||||
|
||||
if (!target) {
|
||||
if (HasTriggerTarget() == false) {
|
||||
theTarget = targetname;
|
||||
}
|
||||
|
||||
|
|
|
@ -104,6 +104,7 @@ public:
|
|||
virtual void Respawn(void);
|
||||
virtual void SpawnKey(string,string);
|
||||
virtual void Touch(entity);
|
||||
virtual void DebugDraw(void);
|
||||
|
||||
nonvirtual void RunOnEntity(entity);
|
||||
nonvirtual void InitIdle(void);
|
||||
|
@ -128,6 +129,25 @@ scripted_sequence::scripted_sequence(void)
|
|||
m_iMove = 0i;
|
||||
}
|
||||
|
||||
void
|
||||
scripted_sequence::DebugDraw(void)
|
||||
{
|
||||
vector pos = GetOrigin();
|
||||
pos[2] += 32;
|
||||
|
||||
R_BeginPolygon("textures/editor/scripted_sequence", 0, 0);
|
||||
R_PolygonVertex(pos + v_right * 24 - v_up * 24, [1,1], [1,1,1], 1.0f);
|
||||
R_PolygonVertex(pos - v_right * 24 - v_up * 24, [0,1], [1,1,1], 1.0f);
|
||||
R_PolygonVertex(pos - v_right * 24 + v_up * 24, [0,0], [1,1,1], 1.0f);
|
||||
R_PolygonVertex(pos + v_right * 24 + v_up * 24, [1,0], [1,1,1], 1.0f);
|
||||
R_EndPolygon();
|
||||
|
||||
R_BeginPolygon("", 0, 0);
|
||||
R_PolygonVertex(GetOrigin(), [0,1], [1,1,1], 0.5);
|
||||
R_PolygonVertex(pos, [1,1], [1,1,1], 0.5);
|
||||
R_EndPolygon();
|
||||
}
|
||||
|
||||
void
|
||||
scripted_sequence::Save(float handle)
|
||||
{
|
||||
|
@ -197,6 +217,8 @@ scripted_sequence::SpawnKey(string strKey, string strValue)
|
|||
void
|
||||
scripted_sequence::Respawn(void)
|
||||
{
|
||||
InitPointTrigger();
|
||||
|
||||
m_iEnabled = TRUE;
|
||||
target = m_oldstrTarget;
|
||||
|
||||
|
|
|
@ -108,6 +108,7 @@ trigger_relay::SpawnKey(string strKey, string strValue)
|
|||
void
|
||||
trigger_relay::Respawn(void)
|
||||
{
|
||||
InitPointTrigger();
|
||||
m_iEnabled = TRUE;
|
||||
m_iValue = FALSE;
|
||||
}
|
||||
|
@ -116,15 +117,15 @@ void
|
|||
trigger_relay::Trigger(entity act, triggermode_t state)
|
||||
{
|
||||
if (m_iEnabled == FALSE) {
|
||||
EntLog("trigger_relay (%s) has already been triggered", targetname);
|
||||
EntLog("trigger_relay %S has already been triggered", targetname);
|
||||
return;
|
||||
}
|
||||
|
||||
if (HasSpawnFlags(TRLY_ONCE)) {
|
||||
if (HasSpawnFlags(TRLY_ONCE) == true) {
|
||||
m_iEnabled = FALSE;
|
||||
}
|
||||
|
||||
m_iValue = TRUE;
|
||||
EntLog("trigger_relay (%s) will trigger %s with state %d", targetname, target, m_iTriggerState);
|
||||
EntLog("trigger_relay %S will trigger %S with state %d", targetname, target, m_iTriggerState);
|
||||
UseTargets(act, m_iTriggerState, m_flDelay);
|
||||
}
|
||||
|
|
|
@ -288,7 +288,8 @@ ambient_generic::UseNormal(entity act, triggermode_t state)
|
|||
msg_entity = this;
|
||||
multicast(origin, MULTICAST_PHS);
|
||||
} else {
|
||||
if not (whichpack(strcat("sound/", m_strActivePath))) {
|
||||
/* if the file doesn't exist, assume it's a SoundDef */
|
||||
if (FileExists(strcat("sound/", m_strActivePath)) == false) {
|
||||
Sound_Play(this, CHAN_BODY, m_strActivePath);
|
||||
} else {
|
||||
sound(this, CHAN_BODY, m_strActivePath, m_flVolume, m_flRadius, m_flPitch);
|
||||
|
|
|
@ -201,7 +201,7 @@ phys_rope::EvaluateEntity(void)
|
|||
entity eFind = find(world, ::targetname, target);
|
||||
|
||||
if (!eFind) {
|
||||
EntError("phys_rope: Unable to find target %S\n", target);
|
||||
EntError("phys_rope: Unable to find target %S", target);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -90,20 +90,12 @@ void
|
|||
NSGameRules::PlayerConnect(NSClientPlayer pl)
|
||||
{
|
||||
if (Plugin_PlayerConnect(pl) == FALSE)
|
||||
bprint(PRINT_HIGH, sprintf("%s connected\n", pl.netname));
|
||||
bprint(PRINT_HIGH, sprintf("%s^d connected.\n", pl.netname));
|
||||
}
|
||||
void
|
||||
NSGameRules::PlayerDisconnect(NSClientPlayer pl)
|
||||
{
|
||||
bprint(PRINT_HIGH, sprintf("%s disconnected\n", pl.netname));
|
||||
|
||||
/* make the client 'unusable' */
|
||||
pl.SetSolid(SOLID_NOT);
|
||||
pl.SetMovetype(MOVETYPE_NONE);
|
||||
pl.SetModelindex(0);
|
||||
pl.SetHealth(0);
|
||||
pl.SetTakedamage(DAMAGE_NO);
|
||||
pl.SetTeam(0);
|
||||
bprint(PRINT_HIGH, sprintf("%s^d disconnected.\n", pl.netname));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -75,7 +75,7 @@
|
|||
|
||||
#define SENDENTITY_ANGLE(field, changedflag) {\
|
||||
if (flChanged & changedflag)\
|
||||
WriteShort(MSG_ENTITY, field * 32767 / 360);\
|
||||
WriteAngle(MSG_ENTITY, field);\
|
||||
}
|
||||
|
||||
#define SENDENTITY_ENTITY(field, changedflag) {\
|
||||
|
|
|
@ -69,11 +69,6 @@ ClientConnect(void)
|
|||
|
||||
for (entity a = world; (a = find(a, ::classname, "player"));)
|
||||
playercount++;
|
||||
|
||||
/* Force node init */
|
||||
if (playercount == 1) {
|
||||
Nodes_Init();
|
||||
}
|
||||
}
|
||||
|
||||
/** Called when a player leaves the server. At the end of the function the
|
||||
|
@ -88,9 +83,18 @@ ClientDisconnect(void)
|
|||
|
||||
/* this will hide/remove the player from other clients */
|
||||
player pl = (player)self;
|
||||
pl.SetSolid(SOLID_NOT);
|
||||
pl.SetMovetype(MOVETYPE_NONE);
|
||||
pl.SetModelindex(0);
|
||||
pl.SetHealth(0);
|
||||
pl.SetTakedamage(DAMAGE_NO);
|
||||
pl.SetTeam(0);
|
||||
pl.Disappear();
|
||||
pl.classname = "";
|
||||
pl.flags = 0;
|
||||
pl.deaths = 0;
|
||||
pl.frags = 0;
|
||||
pl.score = 0;
|
||||
}
|
||||
|
||||
/** Called by the `kill` console command.
|
||||
|
@ -148,7 +152,7 @@ PutClientInServer(void)
|
|||
g_grMode.PlayerSpawn((NSClientPlayer)self);
|
||||
|
||||
/* handle transitions */
|
||||
if (whichpack("data/trans.dat")) {
|
||||
if (FileExists("data/trans.dat")) {
|
||||
|
||||
for (entity a = world; (a = findfloat(a, ::identity, 1));) {
|
||||
NSEntity levelEnt = (NSEntity)a;
|
||||
|
@ -160,6 +164,10 @@ PutClientInServer(void)
|
|||
|
||||
Plugin_PlayerEntered((NSClientPlayer)self);
|
||||
|
||||
if (g_grMode.IsMultiplayer() == true && self.deaths <= 0) {
|
||||
bprint(PRINT_HIGH, sprintf("%s^d entered the game.\n", self.netname));
|
||||
}
|
||||
|
||||
/* activate all game_playerspawn entities */
|
||||
for (entity a = world; (a = find(a, ::targetname, "game_playerspawn"));) {
|
||||
NSEntity t = (NSEntity)a;
|
||||
|
@ -402,6 +410,8 @@ init_respawn(void)
|
|||
|
||||
InitEnd();
|
||||
|
||||
Nodes_Init();
|
||||
|
||||
remove(self);
|
||||
}
|
||||
|
||||
|
@ -695,7 +705,12 @@ SV_PerformLoad(float fh, float entcount, float playerslots)
|
|||
#ifdef REEDICT
|
||||
while ((e=nextent(e))) {
|
||||
if (edict_num(1) != e)
|
||||
remove(e);
|
||||
NSEntity toRemove = (NSEntity)e;
|
||||
if (toRemove.Destroy) {
|
||||
toRemove.Destroy();
|
||||
} else {
|
||||
remove(e);
|
||||
}
|
||||
}
|
||||
#else
|
||||
e = world;
|
||||
|
@ -738,8 +753,13 @@ SV_PerformLoad(float fh, float entcount, float playerslots)
|
|||
loadent = (NSEntity)e;
|
||||
self = eold;
|
||||
} else {
|
||||
NSEntity toRemove = (NSEntity)e;
|
||||
NSError("Could not spawn %s", cname);
|
||||
remove(e);
|
||||
if (toRemove.Destroy) {
|
||||
toRemove.Destroy();
|
||||
} else {
|
||||
remove(e);
|
||||
}
|
||||
self = eold;
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ Mapcycle_Load(string filename)
|
|||
|
||||
/* read the lines in, see if the map exists and define an enumerated alias */
|
||||
while ((temp = fgets(fs_mapcycle))) {
|
||||
if not (whichpack(strcat("maps/", temp, ".bsp")))
|
||||
if (FileExists(strcat("maps/", temp, ".bsp")) == false)
|
||||
continue;
|
||||
|
||||
localcmd(sprintf("alias m%i \"map %s;alias nextmap m%i\"\n", mapcount, temp, mapcount + 1i));
|
||||
|
|
|
@ -112,9 +112,10 @@ Node_Link(node_t *n1, node_t *n2)
|
|||
n->flags = 0;
|
||||
}
|
||||
|
||||
|
||||
/* loop through already existing nodes, test against them and link */
|
||||
static void
|
||||
Node_AutoLink(node_t *new)
|
||||
Node_AutoLink(node_t *new, entity nodeEntity)
|
||||
{
|
||||
int x = new - g_pNodes;
|
||||
|
||||
|
@ -124,20 +125,30 @@ Node_AutoLink(node_t *new)
|
|||
continue;
|
||||
}
|
||||
|
||||
// TODO: Check distance?
|
||||
|
||||
/* can't use full player size, because steps = messy */
|
||||
tracebox(
|
||||
new->origin,
|
||||
[-16,-16,-8],
|
||||
[16,16,32],
|
||||
[-16, -16, -16],
|
||||
[16, 16, 16],
|
||||
g_pNodes[i].origin,
|
||||
MOVE_NORMAL,
|
||||
world
|
||||
nodeEntity
|
||||
);
|
||||
|
||||
/* HACK!: work around c0a0e where info_nodes are blocked by the train */
|
||||
if (trace_ent.movetype == MOVETYPE_PUSH) {
|
||||
tracebox(
|
||||
new->origin,
|
||||
[-16, -16, -16],
|
||||
[16, 16, 16],
|
||||
g_pNodes[i].origin,
|
||||
MOVE_NORMAL,
|
||||
trace_ent
|
||||
);
|
||||
}
|
||||
|
||||
/* line of sight blocked */
|
||||
if (trace_fraction < 1) {
|
||||
if (trace_fraction < 1.0f) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -153,11 +164,22 @@ Nodes_InsertNodeForClassname(string classn)
|
|||
int iID = g_iNodes++;
|
||||
g_pNodes = (node_t *)memrealloc(g_pNodes, sizeof(node_t), iID, g_iNodes);
|
||||
node_t *n = g_pNodes + iID;
|
||||
|
||||
a.solid = SOLID_BBOX;
|
||||
a.movetype = MOVETYPE_WALK;
|
||||
setsize(a, [-16,-16,-16], [16,16,16]);
|
||||
setorigin_safe(a, a.origin);
|
||||
|
||||
n->origin = a.origin;
|
||||
n->nb = __NULL__;
|
||||
n->nb_count = 0;
|
||||
n->radius = 32;
|
||||
Node_AutoLink(n);
|
||||
Node_AutoLink(n, a);
|
||||
|
||||
/* reset it to stupid attributes. */
|
||||
a.solid = SOLID_NOT;
|
||||
a.movetype = MOVETYPE_NONE;
|
||||
setsize(a, [0,0,0], [0,0,0]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -197,7 +219,7 @@ Nodes_Init(void)
|
|||
g_nodes_present = FALSE;
|
||||
|
||||
/* skip if present. TODO: check if they're out of date? */
|
||||
if (whichpack(sprintf("data/%s.way", mapname))) {
|
||||
if (FileExists(sprintf("data/%s.way", mapname))) {
|
||||
g_nodes_present = TRUE;
|
||||
#ifdef NODE_DEBUG
|
||||
NSLog("loading existing nodes for %s", mapname);
|
||||
|
@ -234,6 +256,10 @@ SV_AddDebugPolygons(void)
|
|||
if (cvar("developer") != 1)
|
||||
return;
|
||||
|
||||
if (!g_iWaypoints) {
|
||||
Way_LoadCurrentMapNavMesh();
|
||||
}
|
||||
|
||||
#if 1
|
||||
for (entity s = world; (s = find(s, ::classname, "func_tracktrain"));) {
|
||||
func_tracktrain train = (func_tracktrain)s;
|
||||
|
@ -243,6 +269,13 @@ SV_AddDebugPolygons(void)
|
|||
|
||||
makevectors(self.v_angle);
|
||||
|
||||
for (entity s = world; (s = findfloat(s, ::identity, 1));) {
|
||||
NSEntity drawMe = (NSEntity)s;
|
||||
drawMe.DebugDraw();
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
/* draw the rectangles */
|
||||
R_BeginPolygon("textures/dev/info_node", 0, 0);
|
||||
for (int i = 0; i < g_iNodes; i++) {
|
||||
|
@ -253,38 +286,5 @@ SV_AddDebugPolygons(void)
|
|||
R_PolygonVertex(w->origin + v_right * 8 + v_up * 8, [1,0], NODE_RECT_COLOR, NODE_RECT_ALPHA);
|
||||
R_EndPolygon();
|
||||
}
|
||||
|
||||
for (entity s = world; (s = find(s, ::classname, "path_track"));) {
|
||||
vector pos = s.origin;
|
||||
pos[2] += 32;
|
||||
R_BeginPolygon("textures/dev/path_track", 0, 0);
|
||||
R_PolygonVertex(pos + v_right * 24 - v_up * 24, [1,1], [1,1,1], 1.0f);
|
||||
R_PolygonVertex(pos - v_right * 24 - v_up * 24, [0,1], [1,1,1], 1.0f);
|
||||
R_PolygonVertex(pos - v_right * 24 + v_up * 24, [0,0], [1,1,1], 1.0f);
|
||||
R_PolygonVertex(pos + v_right * 24 + v_up * 24, [1,0], [1,1,1], 1.0f);
|
||||
R_EndPolygon();
|
||||
|
||||
R_BeginPolygon("", 0, 0);
|
||||
R_PolygonVertex(s.origin, [0,1], [1,1,1], NODE_LINE_ALPHA);
|
||||
R_PolygonVertex(pos, [1,1], [1,1,1], NODE_LINE_ALPHA);
|
||||
R_EndPolygon();
|
||||
}
|
||||
|
||||
for (entity s = world; (s = find(s, ::classname, "scripted_sequence"));) {
|
||||
vector pos = s.origin;
|
||||
pos[2] += 32;
|
||||
|
||||
R_BeginPolygon("textures/dev/scripted_sequence", 0, 0);
|
||||
R_PolygonVertex(pos + v_right * 24 - v_up * 24, [1,1], SEQUENCE_RECT_COLOR, NODE_RECT_ALPHA);
|
||||
R_PolygonVertex(pos - v_right * 24 - v_up * 24, [0,1], SEQUENCE_RECT_COLOR, NODE_RECT_ALPHA);
|
||||
R_PolygonVertex(pos - v_right * 24 + v_up * 24, [0,0], SEQUENCE_RECT_COLOR, NODE_RECT_ALPHA);
|
||||
R_PolygonVertex(pos + v_right * 24 + v_up * 24, [1,0], SEQUENCE_RECT_COLOR, NODE_RECT_ALPHA);
|
||||
R_EndPolygon();
|
||||
|
||||
R_BeginPolygon("", 0, 0);
|
||||
R_PolygonVertex(s.origin, [0,1], [1,1,1], NODE_LINE_ALPHA);
|
||||
R_PolygonVertex(pos, [1,1], [1,1,1], NODE_LINE_ALPHA);
|
||||
R_EndPolygon();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -258,7 +258,7 @@ CSEv_CallVote_s(string text)
|
|||
tokenize(text);
|
||||
switch (argv(0)) {
|
||||
case "map":
|
||||
if not (whichpack(sprintf("maps/%s.bsp", argv(1)))) {
|
||||
if (FileExists(sprintf("maps/%s.bsp", argv(1))) == false) {
|
||||
sprint(self, PRINT_CHAT, sprintf("Map '%s' not available on server.\n", argv(1)));
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -120,10 +120,11 @@ public:
|
|||
virtual void Input(entity,string,string);
|
||||
virtual void Save(float);
|
||||
virtual void Restore(string,string);
|
||||
|
||||
/** Called when we need to re-align the entity to our parent entity. */
|
||||
virtual void ParentUpdate(void);
|
||||
|
||||
/* Server-side rendering function. Expensive, but useful. */
|
||||
virtual void DebugDraw(void);
|
||||
|
||||
/** Run each tic after physics are run to determine if we need to send updates over the network. */
|
||||
virtual void EvaluateEntity(void);
|
||||
|
||||
|
|
|
@ -189,6 +189,12 @@ void NSEntity::postdraw( void ) {
|
|||
|
||||
|
||||
#else
|
||||
void
|
||||
NSEntity::DebugDraw(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/* Make sure StartFrame calls this */
|
||||
float NSEntity::SendEntity( entity ePEnt, float flChanged ) {
|
||||
if ( !modelindex )
|
||||
|
|
|
@ -99,6 +99,9 @@ public:
|
|||
Input is the identifier of an output. */
|
||||
nonvirtual bool CheckOutput(string);
|
||||
|
||||
/** Called when we need to re-align the entity to our parent entity. */
|
||||
virtual void ParentUpdate(void);
|
||||
|
||||
/* save game related methods */
|
||||
/** Saves a floating point key/value pair to a filehandle. */
|
||||
nonvirtual void SaveFloat(float,string,float);
|
||||
|
|
|
@ -252,11 +252,11 @@ NSIO::Input(entity eAct, string strInput, string strData)
|
|||
break;
|
||||
default:
|
||||
if (strData != "") {
|
||||
EntWarning("Receives unknown input %S from %d with data %S",
|
||||
strInput, num_for_edict(eAct), strData);
|
||||
EntWarning("Receives unknown input %S from %s (%d) with data %S",
|
||||
strInput, eAct.classname, num_for_edict(eAct), strData);
|
||||
} else {
|
||||
EntWarning("Receives unknown input %S from %d",
|
||||
strInput, num_for_edict(eAct));
|
||||
EntWarning("Receives unknown input %S from %s (%d)",
|
||||
strInput, eAct.classname, num_for_edict(eAct));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -705,6 +705,12 @@ void
|
|||
NSIO::TransitionComplete( void ) {
|
||||
/* this is where we can handle anything post-loading */
|
||||
}
|
||||
|
||||
void
|
||||
NSIO::ParentUpdate(void)
|
||||
{
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
|
|
|
@ -27,4 +27,11 @@ public:
|
|||
|
||||
/** Sets up a point entity trigger with no size. */
|
||||
nonvirtual void InitPointTrigger(void);
|
||||
|
||||
virtual void DebugDraw(void);
|
||||
|
||||
#ifdef SERVER
|
||||
private:
|
||||
string m_strDebugTexture;
|
||||
#endif
|
||||
};
|
||||
|
|
|
@ -14,6 +14,14 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
void
|
||||
NSPointTrigger::NSPointTrigger(void)
|
||||
{
|
||||
#ifdef SERVER
|
||||
m_strDebugTexture = __NULL__;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
NSPointTrigger::InitPointTrigger(void)
|
||||
{
|
||||
|
@ -22,11 +30,19 @@ NSPointTrigger::InitPointTrigger(void)
|
|||
|
||||
#ifdef SERVER
|
||||
m_bEnabled = (m_bStartDisabled) ? false : true;
|
||||
m_strDebugTexture = strcat("textures/editor/", classname);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
NSPointTrigger::NSPointTrigger(void)
|
||||
NSPointTrigger::DebugDraw(void)
|
||||
{
|
||||
#ifdef SERVER
|
||||
R_BeginPolygon(m_strDebugTexture, 0, 0);
|
||||
R_PolygonVertex(GetOrigin() + v_right * 16 - v_up * 16, [1,1], [1,1,1], 1.0f);
|
||||
R_PolygonVertex(GetOrigin() - v_right * 16 - v_up * 16, [0,1], [1,1,1], 1.0f);
|
||||
R_PolygonVertex(GetOrigin() - v_right * 16 + v_up * 16, [0,0], [1,1,1], 1.0f);
|
||||
R_PolygonVertex(GetOrigin() + v_right * 16 + v_up * 16, [1,0], [1,1,1], 1.0f);
|
||||
R_EndPolygon();
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -360,6 +360,7 @@ NSSurfacePropEntity::SpawnKey(string keyName, string setValue)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
NSSurfacePropEntity::Pain(void)
|
||||
{
|
||||
|
|
|
@ -68,12 +68,18 @@ void
|
|||
NSTalkMonster::HandleAnimEvent(float flTimeStamp, int iCode, string strData)
|
||||
{
|
||||
switch(iCode) {
|
||||
#ifdef SERVER
|
||||
case 1005: /* plays a dialogue sentence. monsters only right now */
|
||||
NSTalkMonster targ = (NSTalkMonster)self;
|
||||
targ.Sentence(strData);
|
||||
break;
|
||||
#ifdef SERVER
|
||||
Sentence(strData);
|
||||
#endif
|
||||
break;
|
||||
case 1009: /* play names sequence with 25% chance */
|
||||
#ifdef SERVER
|
||||
if (random() < 0.25) {
|
||||
Sentence(strData);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
super::HandleAnimEvent(flTimeStamp, iCode, strData);
|
||||
}
|
||||
|
|
|
@ -101,16 +101,24 @@ NSTrigger::UseTargets(entity act, int state, float triggerDelay)
|
|||
if (triggerDelay > 0.0f) {
|
||||
EntLog("Scheduling trigger of %S in %f seconds.", target, triggerDelay);
|
||||
NSTrigger eTimer = spawn(NSTrigger);
|
||||
eTimer.netname = sprintf("%s_%d_target_trigger", classname, num_for_edict(this));
|
||||
eTimer.owner = act;
|
||||
eTimer.think = Entities_UseTargets_Think;
|
||||
eTimer.target = target;
|
||||
eTimer.nextthink = time + triggerDelay;
|
||||
eTimer.health = state; /* ugly */
|
||||
|
||||
if (m_strKillTarget) {
|
||||
EntLog("Will kill %S before that happens.", m_strKillTarget);
|
||||
}
|
||||
eTimer.m_strKillTarget = m_strKillTarget;
|
||||
eTimer.m_strMessage = m_strMessage;
|
||||
} else {
|
||||
if (m_strMessage) {
|
||||
env_message_single(act, m_strMessage);
|
||||
}
|
||||
|
||||
if (HasTriggerTarget() == true)
|
||||
for (entity f = world; (f = find(f, ::targetname, target));) {
|
||||
NSTrigger trigger = (NSTrigger)f;
|
||||
|
||||
|
|
|
@ -326,7 +326,7 @@ PropData_ForModel(string modelname)
|
|||
|
||||
if (fh < 0) {
|
||||
g_propdata_count--;
|
||||
NSWarning("No PropData for model %S", modelname);
|
||||
NSLog("No PropData for model %S", modelname);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue