game_team_master/NSTrigger: GetValue() is now aware of who is querying for said information. Required for game_team_master.
This commit is contained in:
parent
d65ab07cf1
commit
25cfc4938e
36 changed files with 116 additions and 60 deletions
1
Doxyfile
1
Doxyfile
|
@ -880,6 +880,7 @@ INPUT = src/ \
|
|||
Documentation/Launching.md \
|
||||
Documentation/Filesystem.md \
|
||||
Documentation/Networking.md \
|
||||
Documentation/EntityGuide.md \
|
||||
Documentation/Classes.md \
|
||||
Documentation/Materials/MatOverview.md \
|
||||
Documentation/Materials/MatCommands.md \
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
ed_for_def()
|
||||
{
|
||||
printf -- "" > "/tmp/def_name"
|
||||
printf -- "" > "/tmp/def_color"
|
||||
printf -- "1 0 1" > "/tmp/def_color"
|
||||
printf -- "" > "/tmp/def_mins"
|
||||
printf -- "" > "/tmp/def_mins"
|
||||
printf -- "" > "/tmp/def_maxs"
|
||||
|
@ -64,6 +64,14 @@ do
|
|||
printf -- "$VAL" > "/tmp/def_usage"
|
||||
fi
|
||||
|
||||
if [ "$KEY" == "netname" ]
|
||||
then
|
||||
if [ -z "$(cat "/tmp/def_usage")" ]
|
||||
then
|
||||
printf -- "$VAL" > "/tmp/def_usage"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$KEY" == "editor_model" ]
|
||||
then
|
||||
printf -- "$VAL" > "/tmp/def_model"
|
||||
|
|
|
@ -343,7 +343,7 @@ func_button::MoverStartsMoving(void)
|
|||
void
|
||||
func_button::Trigger(entity act, triggermode_t state)
|
||||
{
|
||||
if (GetMaster() == FALSE)
|
||||
if (GetMaster(act) == FALSE)
|
||||
return;
|
||||
|
||||
UseOutput(act, m_strOnUseLocked);
|
||||
|
|
|
@ -487,7 +487,7 @@ func_door::MoverStartsMoving(void)
|
|||
void
|
||||
func_door::Trigger(entity act, triggermode_t triggerstate)
|
||||
{
|
||||
if (GetMaster() == 0)
|
||||
if (GetMaster(act) == 0)
|
||||
return;
|
||||
|
||||
if (m_flNextTrigger > time) {
|
||||
|
@ -520,7 +520,7 @@ func_door::Touch(entity eToucher)
|
|||
if (HasSpawnFlags(SF_MOV_USE) == true)
|
||||
return;
|
||||
|
||||
if (m_iLocked || !GetMaster()) {
|
||||
if (m_iLocked || !GetMaster(eToucher)) {
|
||||
if (m_flSoundWait < time)
|
||||
Sound_Play(this, CHAN_VOICE, m_strLockedSfx);
|
||||
|
||||
|
|
|
@ -411,7 +411,7 @@ func_door_rotating::MoverStartsMoving(void)
|
|||
void
|
||||
func_door_rotating::Trigger(entity act, triggermode_t state)
|
||||
{
|
||||
if (GetMaster() == FALSE) {
|
||||
if (GetMaster(act) == FALSE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -465,7 +465,7 @@ func_door_rotating::Touch(entity eToucher)
|
|||
return;
|
||||
}
|
||||
|
||||
if (m_iLocked || !GetMaster()) {
|
||||
if (m_iLocked || !GetMaster(eToucher)) {
|
||||
if (m_flSoundWait < time)
|
||||
Sound_Play(this, CHAN_VOICE, m_strLockedSfx);
|
||||
|
||||
|
|
|
@ -89,6 +89,7 @@ private:
|
|||
float m_flDamage;
|
||||
float m_flHeight;
|
||||
float m_flStartSpeed;
|
||||
float m_flCurrentSpeed;
|
||||
float m_flBank;
|
||||
string m_strMoveSnd;
|
||||
string m_strStopSnd;
|
||||
|
@ -182,6 +183,9 @@ void
|
|||
func_tracktrain::SpawnKey(string strKey, string strValue)
|
||||
{
|
||||
switch (strKey) {
|
||||
case "speed":
|
||||
m_flSpeed = ReadFloat(strValue);
|
||||
break;
|
||||
case "startspeed":
|
||||
m_flStartSpeed = stof(strValue);
|
||||
break;
|
||||
|
@ -237,7 +241,7 @@ func_tracktrain::Respawn(void)
|
|||
SetModel(GetSpawnModel());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
|
||||
m_flSpeed = m_flStartSpeed;
|
||||
m_flCurrentSpeed = m_flStartSpeed;
|
||||
|
||||
ScheduleThink(AfterSpawn, 0.0f);
|
||||
SetTriggerTarget(m_oldstrTarget);
|
||||
|
@ -296,7 +300,7 @@ func_tracktrain::PathMove(void)
|
|||
vecWorldPos = origin;
|
||||
|
||||
vecVelocity = (eNode.origin + [0,0,m_flHeight]) - vecWorldPos;
|
||||
flTravelTime = (vlen(vecVelocity) / m_flSpeed);
|
||||
flTravelTime = (vlen(vecVelocity) / m_flCurrentSpeed);
|
||||
|
||||
if (!flTravelTime) {
|
||||
print("^1func_tracktrain::^3PathMove^7: Distance short, going next\n");
|
||||
|
@ -399,7 +403,9 @@ func_tracktrain::PathNext(void)
|
|||
|
||||
/* if speed is 0, retain current speed */
|
||||
if (eNode.m_flSpeed > 0)
|
||||
m_flSpeed = eNode.m_flSpeed;
|
||||
m_flCurrentSpeed = eNode.m_flSpeed;
|
||||
else
|
||||
m_flCurrentSpeed = m_flSpeed;
|
||||
|
||||
m_flWait = eNode.m_flWait;
|
||||
target = eNode.target;
|
||||
|
@ -447,7 +453,9 @@ func_tracktrain::AfterSpawn(void)
|
|||
|
||||
/* if speed is 0, retain current speed */
|
||||
if (eNode.m_flSpeed > 0)
|
||||
m_flSpeed = eNode.m_flSpeed;
|
||||
m_flCurrentSpeed = eNode.m_flSpeed;
|
||||
else
|
||||
m_flCurrentSpeed = m_flSpeed;
|
||||
|
||||
m_flWait = eNode.m_flWait;
|
||||
target = eNode.target;
|
||||
|
|
|
@ -60,6 +60,8 @@ func_train:NSRenderableEntity
|
|||
float m_flWait;
|
||||
float m_flSpeed;
|
||||
float m_flDamage;
|
||||
float m_flCurrentSpeed;
|
||||
|
||||
string m_strMoveSnd;
|
||||
string m_strStopSnd;
|
||||
|
||||
|
@ -87,7 +89,7 @@ void
|
|||
func_train::func_train(void)
|
||||
{
|
||||
m_flWait = 0.0f;
|
||||
m_flSpeed = 100.0f; /* FIXME: This is all decided by the first path_corner pretty much */
|
||||
m_flSpeed = 0.0f; /* FIXME: This is all decided by the first path_corner pretty much */
|
||||
m_flDamage = 0.0f;
|
||||
m_strMoveSnd = __NULL__;
|
||||
m_strStopSnd = __NULL__;
|
||||
|
@ -141,6 +143,9 @@ func_train::SpawnKey(string strKey, string strValue)
|
|||
case "snd_stop":
|
||||
m_strStopSnd = strValue;
|
||||
break;
|
||||
case "speed":
|
||||
m_flSpeed = ReadFloat(strValue);
|
||||
break;
|
||||
/* compatibility */
|
||||
case "movesnd":
|
||||
m_strMoveSnd = sprintf("func_train.move_%i", stoi(strValue) + 1i);
|
||||
|
@ -217,12 +222,15 @@ func_train::SoundStop(void)
|
|||
void
|
||||
func_train::PathMove(void)
|
||||
{
|
||||
entity eNode;
|
||||
path_corner eNode;
|
||||
float flTravelTime;
|
||||
vector vecVelocity;
|
||||
vector vecWorldPos;
|
||||
|
||||
eNode = find(world, ::targetname, target);
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
eNode = (path_corner)find(world, ::targetname, target);
|
||||
|
||||
if (!eNode) {
|
||||
return;
|
||||
|
@ -230,7 +238,7 @@ func_train::PathMove(void)
|
|||
|
||||
vecWorldPos = WorldSpaceCenter();
|
||||
vecVelocity = (eNode.origin - vecWorldPos);
|
||||
flTravelTime = (vlen(vecVelocity) / m_flSpeed);
|
||||
flTravelTime = (vlen(vecVelocity) / m_flCurrentSpeed);
|
||||
|
||||
if (!flTravelTime) {
|
||||
print("^1func_train::^3PathMove^7: Distance short, going next\n");
|
||||
|
@ -240,6 +248,7 @@ func_train::PathMove(void)
|
|||
}
|
||||
|
||||
SoundMove();
|
||||
NSLog("Travelling at %f up/s", m_flSpeed);
|
||||
|
||||
SetVelocity(vecVelocity * (1 / flTravelTime));
|
||||
ScheduleThink(PathNext, flTravelTime);
|
||||
|
@ -268,6 +277,10 @@ void
|
|||
func_train::PathNext(void)
|
||||
{
|
||||
path_corner eNode;
|
||||
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
eNode = (path_corner)find(world, ::targetname, target);
|
||||
|
||||
if (!eNode) {
|
||||
|
@ -277,9 +290,15 @@ func_train::PathNext(void)
|
|||
SetOrigin(eNode.origin - (mins + maxs) * 0.5);
|
||||
PathDone();
|
||||
|
||||
if (eNode.m_flSpeed > 0.0f) {
|
||||
m_flCurrentSpeed = eNode.m_flSpeed;
|
||||
} else {
|
||||
m_flCurrentSpeed = m_flSpeed;
|
||||
}
|
||||
|
||||
/* if speed is 0, retain current speed */
|
||||
if (eNode.m_flSpeed > 0)
|
||||
m_flSpeed = eNode.m_flSpeed;
|
||||
//if (eNode.m_flSpeed > 0.0f)
|
||||
//m_flSpeed = eNode.m_flSpeed;
|
||||
|
||||
m_flWait = eNode.m_flWait;
|
||||
SetTriggerTarget(eNode.target);
|
||||
|
|
|
@ -123,6 +123,7 @@ game_counter::Respawn(void)
|
|||
void
|
||||
game_counter::SetCount(int value)
|
||||
{
|
||||
NSLog("%s's count set to %i", targetname, value);
|
||||
m_iCounted = value;
|
||||
}
|
||||
|
||||
|
@ -135,14 +136,20 @@ game_counter::GetCount(void)
|
|||
void
|
||||
game_counter::Trigger(entity act, triggermode_t state)
|
||||
{
|
||||
if (GetMaster() == FALSE)
|
||||
if (GetMaster(act) == FALSE)
|
||||
return;
|
||||
|
||||
NSLog("%s's incremented by 1", targetname);
|
||||
m_iCounted++;
|
||||
|
||||
if (m_iCounted < m_iMaxCount)
|
||||
return;
|
||||
|
||||
NSLog("%s's triggering %s", targetname, target);
|
||||
//print(sprintf("%s %s %i %i\n", classname, targetname, m_iCounted, m_iMaxCount ));
|
||||
//error(sprintf("%s %i %i\n", act.classname, m_iCounted, m_iMaxCount ));
|
||||
UseTargets(act, TRIG_TOGGLE, m_flDelay);
|
||||
|
||||
if (HasSpawnFlags(GMCNT_REMOVE))
|
||||
Destroy();
|
||||
else if (HasSpawnFlags(GMCNT_RESET))
|
||||
|
@ -150,5 +157,4 @@ game_counter::Trigger(entity act, triggermode_t state)
|
|||
else
|
||||
m_iValue = 1;
|
||||
|
||||
UseTargets(act, TRIG_TOGGLE, m_flDelay);
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ private:
|
|||
void
|
||||
game_counter_set::game_counter_set(void)
|
||||
{
|
||||
m_iCount = 0;
|
||||
m_iCount = 0i;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -82,7 +82,7 @@ game_counter_set::SpawnKey(string strKey, string strValue)
|
|||
{
|
||||
switch (strKey) {
|
||||
case "frags":
|
||||
m_iCount = stoi(strValue);
|
||||
m_iCount = ReadInt(strValue);
|
||||
break;
|
||||
default:
|
||||
super::SpawnKey(strKey, strValue);
|
||||
|
@ -98,9 +98,11 @@ game_counter_set::Respawn(void)
|
|||
void
|
||||
game_counter_set::Trigger(entity act, triggermode_t state)
|
||||
{
|
||||
if (GetMaster() == FALSE)
|
||||
if (GetMaster(act) == FALSE)
|
||||
return;
|
||||
|
||||
NSLog("%s's manipulating %s to be %i", targetname, target, m_iCount);
|
||||
|
||||
/* apply the value to all the relevant game_counter entities */
|
||||
for (entity f = world; (f = find(f, ::targetname, target));) {
|
||||
game_counter targ;
|
||||
|
|
|
@ -42,7 +42,7 @@ game_end::game_end(void)
|
|||
void
|
||||
game_end::Trigger(entity activatingEntity, triggermode_t triggerMode)
|
||||
{
|
||||
if (GetMaster() == FALSE) {
|
||||
if (GetMaster(activatingEntity) == FALSE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ game_player_hurt::Restore(string strKey, string strValue)
|
|||
void
|
||||
game_player_hurt::Trigger(entity activatingEntity, triggermode_t triggerMode)
|
||||
{
|
||||
if (GetMaster() == FALSE) {
|
||||
if (GetMaster(activatingEntity) == FALSE) {
|
||||
return;
|
||||
}
|
||||
if (!(activatingEntity.flags & FL_CLIENT)) {
|
||||
|
|
|
@ -51,7 +51,7 @@ game_player_team::Trigger(entity entityActivator, triggermode_t state)
|
|||
NSClientPlayer targetPlayer = __NULL__;
|
||||
game_team_master toRead = __NULL__;
|
||||
|
||||
if (GetMaster() == FALSE) {
|
||||
if (GetMaster(entityActivator) == FALSE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ game_score::Trigger(entity entityActivator, triggermode_t state)
|
|||
{
|
||||
int toAdd = m_iPoints;
|
||||
|
||||
if (GetMaster() == FALSE) {
|
||||
if (GetMaster(entityActivator) == FALSE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ public:
|
|||
virtual void SpawnKey(string, string);
|
||||
virtual void Input(entity, string, string);
|
||||
virtual void Trigger(entity, triggermode_t);
|
||||
|
||||
virtual int GetValue(entity);
|
||||
nonvirtual void SetTeamIndex(int);
|
||||
nonvirtual int GetTeamIndex(void);
|
||||
|
||||
|
@ -99,7 +99,7 @@ game_team_master::SpawnKey(string keyName, string setValue)
|
|||
void
|
||||
game_team_master::Trigger(entity entityActivator, triggermode_t state)
|
||||
{
|
||||
if (GetMaster() == FALSE) {
|
||||
if (GetMaster(entityActivator) == FALSE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -125,6 +125,15 @@ game_team_master::Input(entity entityActivator, string inputName, string dataFie
|
|||
}
|
||||
}
|
||||
|
||||
int
|
||||
game_team_master::GetValue(entity queryingEntity)
|
||||
{
|
||||
if (queryingEntity.team == (float)m_iTeamIndex)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
game_team_master::SetTeamIndex(int newIndex)
|
||||
{
|
||||
|
|
|
@ -48,7 +48,7 @@ game_team_set::Trigger(entity activatorEntity, triggermode_t state)
|
|||
{
|
||||
game_team_master toChange = __NULL__;
|
||||
|
||||
if (GetMaster() == FALSE) {
|
||||
if (GetMaster(activatorEntity) == FALSE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -301,7 +301,7 @@ multi_manager::Trigger(entity act, triggermode_t state)
|
|||
UseTargets(wow.m_eActivator, TRIG_TOGGLE, 0.0f);
|
||||
}
|
||||
|
||||
if (GetMaster() == FALSE)
|
||||
if (GetMaster(act) == FALSE)
|
||||
return;
|
||||
|
||||
m_iValue = TRUE;
|
||||
|
|
|
@ -37,7 +37,7 @@ public:
|
|||
|
||||
virtual void Respawn(void);
|
||||
virtual int QueryTargets(void);
|
||||
virtual int GetValue(void);
|
||||
virtual int GetValue(entity);
|
||||
virtual void Trigger(entity, triggermode_t);
|
||||
|
||||
};
|
||||
|
@ -68,7 +68,7 @@ multisource::Trigger(entity act, triggermode_t unused)
|
|||
}
|
||||
|
||||
int
|
||||
multisource::GetValue(void)
|
||||
multisource::GetValue(entity queryingEntity)
|
||||
{
|
||||
return QueryTargets();
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ multisource::QueryTargets(void)
|
|||
if (cvar("developer") == 1) {
|
||||
dprint("[^1MULTISOURCE^7] ");
|
||||
dprint(tTemp.classname);
|
||||
if (tTemp.GetValue() == FALSE) {
|
||||
if (tTemp.GetValue(this) == FALSE) {
|
||||
dprint(" is ^1OFF^7, name: ");
|
||||
out = FALSE;
|
||||
} else {
|
||||
|
@ -102,7 +102,7 @@ multisource::QueryTargets(void)
|
|||
dprint("\n");
|
||||
} else {
|
||||
/* exit out immediately as there's no point unless in-dev */
|
||||
if (tTemp.GetValue() == FALSE) {
|
||||
if (tTemp.GetValue(this) == FALSE) {
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ void
|
|||
path_corner::path_corner(void)
|
||||
{
|
||||
m_iFired = 0i;
|
||||
m_flSpeed = 100.0f;
|
||||
m_flSpeed = 0.0f;
|
||||
m_flYawSpeed = 0.0f;
|
||||
m_flWait = 1.0f;
|
||||
}
|
||||
|
@ -110,16 +110,16 @@ path_corner::SpawnKey(string strKey, string strValue)
|
|||
{
|
||||
switch (strKey) {
|
||||
case "speed":
|
||||
m_flSpeed = stof(strValue);
|
||||
m_flSpeed = ReadFloat(strValue);
|
||||
break;
|
||||
case "yaw_speed":
|
||||
m_flYawSpeed = stof(strValue);
|
||||
m_flYawSpeed = ReadFloat(strValue);
|
||||
break;
|
||||
case "wait":
|
||||
m_flWait = stof(strValue);
|
||||
m_flWait = ReadFloat(strValue);
|
||||
break;
|
||||
case "message":
|
||||
m_strMessage = strValue;
|
||||
m_strMessage = ReadString(strValue);
|
||||
break;
|
||||
default:
|
||||
super::SpawnKey(strKey, strValue);
|
||||
|
|
|
@ -219,7 +219,7 @@ point_trigger::Input(entity eAct, string strInput, string strData)
|
|||
void
|
||||
point_trigger::Touch(entity eToucher)
|
||||
{
|
||||
if (GetMaster() == false)
|
||||
if (GetMaster(eToucher) == false)
|
||||
return;
|
||||
if (m_bEnabled == false)
|
||||
return;
|
||||
|
|
|
@ -132,7 +132,7 @@ random_speaker::Respawn(void)
|
|||
void
|
||||
random_speaker::Trigger(entity act, triggermode_t state)
|
||||
{
|
||||
if (GetMaster() == FALSE)
|
||||
if (GetMaster(act) == FALSE)
|
||||
return;
|
||||
|
||||
switch (state) {
|
||||
|
|
|
@ -123,7 +123,7 @@ random_trigger::Trigger(entity act, triggermode_t state)
|
|||
{
|
||||
float r;
|
||||
|
||||
if (GetMaster() == FALSE)
|
||||
if (GetMaster(act) == FALSE)
|
||||
return;
|
||||
|
||||
r = time + m_flMinTime + random(m_flRandMin, m_flRandMax);
|
||||
|
|
|
@ -104,7 +104,7 @@ targ_speaker::Respawn(void)
|
|||
void
|
||||
targ_speaker::Trigger(entity act, triggermode_t state)
|
||||
{
|
||||
if (GetMaster() == FALSE)
|
||||
if (GetMaster(act) == FALSE)
|
||||
return;
|
||||
|
||||
sound(this, CHAN_AUTO, m_strSample, m_flVolume, ATTN_NORM);
|
||||
|
|
|
@ -86,7 +86,7 @@ trigger_autosave::Respawn(void)
|
|||
void
|
||||
trigger_autosave::Touch(entity eToucher)
|
||||
{
|
||||
if (GetMaster() == FALSE)
|
||||
if (GetMaster(eToucher) == FALSE)
|
||||
return;
|
||||
|
||||
/* saved text */
|
||||
|
|
|
@ -279,7 +279,7 @@ trigger_changelevel::Change(void)
|
|||
void
|
||||
trigger_changelevel::Trigger(entity act, triggermode_t unused)
|
||||
{
|
||||
if (GetMaster() == FALSE)
|
||||
if (GetMaster(act) == FALSE)
|
||||
return;
|
||||
|
||||
/* disable meself */
|
||||
|
|
|
@ -111,7 +111,7 @@ trigger_counter::Trigger(entity act, triggermode_t state)
|
|||
return;
|
||||
if (HasSpawnFlags(TRCNT_NOCLIENTS) && act.flags & FL_CLIENT)
|
||||
return;
|
||||
if (GetMaster() == FALSE)
|
||||
if (GetMaster(act) == FALSE)
|
||||
return;
|
||||
|
||||
m_iCounted++;
|
||||
|
|
|
@ -50,7 +50,7 @@ trigger_endsection::Respawn(void)
|
|||
void
|
||||
trigger_endsection::Trigger(entity act, triggermode_t state)
|
||||
{
|
||||
if (GetMaster() == FALSE)
|
||||
if (GetMaster(act) == FALSE)
|
||||
return;
|
||||
|
||||
localcmd("disconnect\n");
|
||||
|
|
|
@ -157,7 +157,7 @@ trigger_look::Touch(entity eToucher)
|
|||
float dot;
|
||||
entity lt;
|
||||
|
||||
if (GetMaster() == FALSE)
|
||||
if (GetMaster(eToucher) == FALSE)
|
||||
return;
|
||||
|
||||
if (!(eToucher.flags & FL_CLIENT)) {
|
||||
|
|
|
@ -204,7 +204,7 @@ trigger_multiple::Input(entity entityActivator, string inputName, string dataFie
|
|||
void
|
||||
trigger_multiple::Touch(entity eToucher)
|
||||
{
|
||||
if (GetMaster() == FALSE)
|
||||
if (GetMaster(eToucher) == FALSE)
|
||||
return;
|
||||
|
||||
if (m_bEnabled == false)
|
||||
|
@ -218,6 +218,8 @@ trigger_multiple::Touch(entity eToucher)
|
|||
return;
|
||||
if (!HasSpawnFlags(TM_PUSHABLES) && eToucher.classname == "func_pushable")
|
||||
return;
|
||||
if (eToucher.solid == SOLID_TRIGGER)
|
||||
return;
|
||||
} else if (CanBeTriggeredBy(eToucher) == false) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -173,7 +173,7 @@ trigger_once::Touch(entity eToucher)
|
|||
{
|
||||
bool isPushable = (substring(eToucher.classname, 0, 5) == "func_") ? true : false;
|
||||
|
||||
if (GetMaster() == FALSE)
|
||||
if (GetMaster(eToucher) == FALSE)
|
||||
return;
|
||||
|
||||
if (m_bEnabled == false)
|
||||
|
|
|
@ -55,7 +55,7 @@ trigger_playerfreeze::Respawn(void)
|
|||
void
|
||||
trigger_playerfreeze::Trigger(entity act, triggermode_t state)
|
||||
{
|
||||
if (GetMaster() == FALSE)
|
||||
if (GetMaster(act) == FALSE)
|
||||
return;
|
||||
|
||||
m_iValue = 1 - m_iValue;
|
||||
|
|
|
@ -168,7 +168,7 @@ trigger_teleport::Respawn(void)
|
|||
void
|
||||
trigger_teleport::Touch(entity eToucher)
|
||||
{
|
||||
if (GetMaster() == FALSE)
|
||||
if (GetMaster(eToucher) == FALSE)
|
||||
return;
|
||||
if (m_bEnabled == false)
|
||||
return;
|
||||
|
|
|
@ -45,6 +45,7 @@ void
|
|||
trigger_transition::Respawn(void)
|
||||
{
|
||||
InitBrushTrigger();
|
||||
SetSolid(SOLID_NOT);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -26,7 +26,7 @@ public:
|
|||
void NSBrushTrigger(void);
|
||||
|
||||
/* overrides */
|
||||
virtual int GetValue(void);
|
||||
virtual int GetValue(entity);
|
||||
|
||||
/** Sets up a brush trigger volume based on the brush information. */
|
||||
nonvirtual void InitBrushTrigger(void);
|
||||
|
|
|
@ -20,7 +20,7 @@ NSBrushTrigger::NSBrushTrigger(void)
|
|||
}
|
||||
|
||||
int
|
||||
NSBrushTrigger::GetValue(void)
|
||||
NSBrushTrigger::GetValue(entity queryingEntity)
|
||||
{
|
||||
if (GetSolid() == SOLID_NOT) {
|
||||
return (1);
|
||||
|
|
|
@ -101,7 +101,7 @@ public:
|
|||
/* master feature */
|
||||
/** Returns what we will pass onto other's `::GetMaster()` calls if we're their master. */
|
||||
/* multisource overrides this, so keep virtual */
|
||||
virtual int GetValue(void);
|
||||
virtual int GetValue(entity);
|
||||
|
||||
/** When called will trigger its legacy targets with a given delay. */
|
||||
nonvirtual void UseTargets(entity,int,float);
|
||||
|
@ -109,8 +109,8 @@ public:
|
|||
/** Sets the legacy target for this entity. */
|
||||
nonvirtual void SetTriggerTarget(string);
|
||||
|
||||
/** Returns whether our master allows us to be triggered. */
|
||||
nonvirtual int GetMaster(void);
|
||||
/** Returns whether our master allows us to be triggered. The argument specifies who's requesting the info for the master. Required for game_team_master to verify against players. */
|
||||
nonvirtual int GetMaster(entity);
|
||||
|
||||
/** Returns the value of a given env_global property */
|
||||
nonvirtual globalstate_t GetGlobalValue(string);
|
||||
|
|
|
@ -140,7 +140,7 @@ NSTrigger::SetTriggerTarget(string name)
|
|||
}
|
||||
|
||||
int
|
||||
NSTrigger::GetValue(void)
|
||||
NSTrigger::GetValue(entity queryingEntity)
|
||||
{
|
||||
return m_iValue;
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ NSTrigger::GetGlobalValue(string strName)
|
|||
}
|
||||
|
||||
int
|
||||
NSTrigger::GetMaster(void)
|
||||
NSTrigger::GetMaster(entity queryingEntity)
|
||||
{
|
||||
NSTrigger t;
|
||||
|
||||
|
@ -177,14 +177,14 @@ NSTrigger::GetMaster(void)
|
|||
return (1);
|
||||
}
|
||||
|
||||
if (t.GetValue() == 1)
|
||||
if (t.GetValue(queryingEntity) == 1)
|
||||
NSLog("^2%s::^3GetMaster^7: %s learns %s ^2POSITIVE",
|
||||
classname, targetname, m_strMaster);
|
||||
else
|
||||
NSLog("^2%s::^3GetMaster^7: %s learns %s ^1NEGATIVE",
|
||||
classname, targetname, m_strMaster);
|
||||
|
||||
return t.GetValue();
|
||||
return t.GetValue(queryingEntity);
|
||||
}
|
||||
|
||||
string
|
||||
|
|
Loading…
Reference in a new issue