trigger_relay: Set m_iValue so that multisources will work properly that get targetted by them

trigger_auto: Delay the trigger of them in singleplayer until 1 player has joined
Misc cleanups. The 'Janitor Simulator' on TWHL should work now.
This commit is contained in:
Marco Cawthorne 2022-12-14 16:51:16 -08:00
parent 33295ff409
commit 2d911109cc
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
89 changed files with 2260 additions and 329 deletions

View File

@ -22,8 +22,9 @@ entity, oneMinusEntity, fromVertex, and lightingDiffuse.
Follow this up with a vector of the color that you'd like the vertex
colors to be set as. An example for green would be:
` rgbGen const 0.0 1.0 0.0`
```
rgbGen const 0.0 1.0 0.0
```
#### identityLighting {#identitylighting}

View File

@ -31,22 +31,23 @@ clouds. This has not be tested in a long time, so it probably doesn't
actually work. Set to "-" to ignore.
### Example Sky Material {#example_sky_material}
`   // Vera Visions Material`
`   {`
`       qer_editorImage textures/skies/dune.tga`
`       skyParms textures/skies/dune/bg 256 -`
`       noPicMip`
`       noMipmaps`
`       `
`       surfaceParm sky`
`       surfaceParm noimpact`
`       surfaceParm nolightmap`
`       surfaceParm nodlight`
`       {`
`           program skybox`
`           map $cube:textures/skies/dune/bg`
`           map textures/skies/clouds/dunecloud.tga`
`           map textures/skies/clouds/dunecloud_layer.tga`
`       }`
`   }`
```
   // Vera Visions Material
   {
       qer_editorImage textures/skies/dune.tga
       skyParms textures/skies/dune/bg 256 -
       noPicMip
       noMipmaps
       
       surfaceParm sky
       surfaceParm noimpact
       surfaceParm nolightmap
       surfaceParm nodlight
       {
           program skybox
           map $cube:textures/skies/dune/bg
           map textures/skies/clouds/dunecloud.tga
           map textures/skies/clouds/dunecloud_layer.tga
       }
   }
```

View File

@ -21,8 +21,10 @@ precision, and that can disturb other operations.
Texture coordinates are modified in the order in which **tcMods** are
specified. In otherwords, if you see:
` tcMod scale 0.5 0.5`
` tcMod scroll 1 1`
```
 tcMod scale 0.5 0.5
 tcMod scroll 1 1
```
Then the texture coordinates will be **scaled then**scrolled'''.

1877
Documentation/style.css Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1230,7 +1230,7 @@ HTML_FOOTER =
# obsolete.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_STYLESHEET =
HTML_STYLESHEET = Documentation/style.css
# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
# cascading style sheets that are included after the standard style sheets

View File

@ -147,7 +147,7 @@ CMD_ListModels(void)
int i = 0i;
int actual_count = 0i;
for (int i = -4096; i < 4096; i++) {
for (i = -4096; i < 4096; i++) {
tmp = modelnameforindex(i);
if (strlen(tmp) > 1) {
@ -168,7 +168,7 @@ CMD_ListSounds(void)
float length;
float total_length = 0.0f;
for (int i = 0; i < 4096; i++) {
for (i = 0; i < 4096; i++) {
tmp = soundnameforindex(i);
length = soundlength(tmp);
@ -189,7 +189,7 @@ CMD_ListParticles(void)
int i = 0i;
int actual_count = 0i;
for (int i = -4096; i < 4096; i++) {
for (i = -4096; i < 4096; i++) {
tmp = particleeffectquery(i, 0);
if (strlen(tmp) > 1) {

View File

@ -44,7 +44,7 @@ public:
void button_target(void);
virtual void Respawn(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity,triggermode_t);
virtual void Damage(void);
};
@ -80,7 +80,7 @@ button_target::Respawn(void)
}
void
button_target::Trigger(entity act, int status)
button_target::Trigger(entity act, triggermode_t status)
{
/* make unusable */
PlayerUse = __NULL__;

View File

@ -41,7 +41,6 @@ public:
virtual void Respawn(void);
virtual void Pain(void);
};
void

View File

@ -66,7 +66,7 @@ public:
virtual void Restore(string,string);
virtual void SpawnKey(string,string);
virtual void Spawned(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
private:
int m_iUses;
@ -140,7 +140,7 @@ env_beverage::Spawned(void)
}
void
env_beverage::Trigger(entity act, int unused)
env_beverage::Trigger(entity act, triggermode_t unused)
{
if (m_bReady == false || m_iUses <= 0) {
return;

View File

@ -58,7 +58,7 @@ public:
/* overrides */
virtual void Save(float);
virtual void Restore(string,string);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void SpawnKey(string,string);
virtual void Respawn(void);
@ -118,7 +118,7 @@ env_explosion::Respawn(void)
}
void
env_explosion::Trigger(entity act, int state)
env_explosion::Trigger(entity act, triggermode_t state)
{
FX_Explosion(origin);

View File

@ -54,7 +54,7 @@ public:
/* overrides */
virtual void Save(float);
virtual void Restore(string,string);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void SpawnKey(string,string);
};
@ -104,7 +104,7 @@ env_fade::SpawnKey(string strKey, string strValue)
}
void
env_fade::Trigger(entity eAct, int iState)
env_fade::Trigger(entity eAct, triggermode_t iState)
{
/* Half-Life ignores states entirely for env_fade's being triggered */
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);

View File

@ -48,7 +48,7 @@ public:
virtual void Restore(string,string);
virtual void SpawnKey(string,string);
virtual void Spawned(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual int GlobalPresent(string);
virtual void AddNewGlobal(string,globalstate_t);
@ -119,7 +119,7 @@ env_global::Spawned(void)
}
void
env_global::Trigger(entity act, int state)
env_global::Trigger(entity act, triggermode_t state)
{
globalstate_t iOldValue = GetGlobalValue(m_strGlobalState);
globalstate_t newValue = 0;

View File

@ -51,7 +51,7 @@ public:
virtual void Save(float);
virtual void Restore(string,string);
virtual void SpawnKey(string,string);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
};
@ -93,7 +93,7 @@ env_hudhint::SpawnKey(string strKey, string strValue)
}
void
env_hudhint::Trigger(entity act, int state)
env_hudhint::Trigger(entity act, triggermode_t state)
{
env_hudhint_send(act, m_strMessage, spawnflags);
}

View File

@ -55,7 +55,7 @@ public:
virtual void SpawnKey(string,string);
virtual void Respawn(void);
virtual void Play(entity,int);
virtual void Play(entity, triggermode_t);
};
@ -119,7 +119,7 @@ env_message::Respawn(void)
}
void
env_message::Play(entity act, int state)
env_message::Play(entity act, triggermode_t state)
{
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EV_MESSAGE);

View File

@ -81,7 +81,7 @@ env_render:NSRenderableEntity
public:
void env_render(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
};
@ -91,7 +91,7 @@ env_render::env_render(void)
}
void
env_render::Trigger(entity act, int state)
env_render::Trigger(entity act, triggermode_t state)
{
for (entity e = world;
(e = find(e, ::targetname, target));) {

View File

@ -49,7 +49,7 @@ public:
virtual void Save(float);
virtual void Restore(string,string);
virtual void SpawnKey(string,string);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
};
@ -115,7 +115,7 @@ env_shake::SpawnKey(string strKey, string strValue)
}
void
env_shake::Trigger(entity act, int state)
env_shake::Trigger(entity act, triggermode_t state)
{
Client_ShakeOnce(origin, m_flRadius, m_flDuration, m_flFrequency, m_flAmplitude);
}

View File

@ -60,7 +60,7 @@ public:
virtual void SpawnKey(string,string);
virtual void Respawn(void);
virtual void ShootGib(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
};
@ -213,7 +213,7 @@ env_shooter::ShootGib(void)
}
void
env_shooter::Trigger(entity act, int state)
env_shooter::Trigger(entity act, triggermode_t state)
{
switch (state) {
case TRIG_OFF:

View File

@ -60,7 +60,7 @@ public:
virtual void SpawnKey(string,string);
virtual void Spawned(void);
virtual void Respawn(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void CreateSpark(void);
virtual void TimedSpark(void);
@ -124,7 +124,7 @@ env_spark::Respawn(void)
}
void
env_spark::Trigger(entity act, int state)
env_spark::Trigger(entity act, triggermode_t state)
{
if (!HasSpawnFlags(EVSPARK_TOGGLE)) {
CreateSpark();

View File

@ -43,7 +43,7 @@ public:
/* overrides */
virtual void Respawn(void);
virtual void SpawnKey(string,string);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void Input(entity,string,string);
virtual void PortalOpen(void);
@ -86,7 +86,7 @@ func_areaportal::SpawnKey(string strKey, string strValue)
}
void
func_areaportal::Trigger(entity act, int state)
func_areaportal::Trigger(entity act, triggermode_t state)
{
if (state == TRIG_OFF) {
PortalClose();

View File

@ -139,7 +139,7 @@ public:
virtual void Respawn(void);
virtual void Pain(void);
virtual void Death(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void Explode(void);
virtual void Touch(entity);
@ -355,7 +355,7 @@ func_breakable::Death(void)
}
void
func_breakable::Trigger(entity act, int state)
func_breakable::Trigger(entity act, triggermode_t state)
{
if (GetHealth() > 0)
Death();

View File

@ -50,7 +50,7 @@ public:
virtual void Save(float);
virtual void Restore(string,string);
virtual void Respawn(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void SpawnKey(string,string);
};
@ -123,7 +123,7 @@ func_brush::Respawn(void)
}
void
func_brush::Trigger(entity act, int state)
func_brush::Trigger(entity act, triggermode_t state)
{
/* collision */
switch (m_iSolidity) {

View File

@ -117,7 +117,7 @@ public:
virtual void MoveAway(void);
virtual void Touch(entity);
virtual void Blocked(entity);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void DeathTrigger(void);
virtual void PlayerUse(void);
virtual void SetMovementDirection(void);
@ -412,7 +412,7 @@ func_button::MoveAway(void)
/* TODO: Handle state */
void
func_button::Trigger(entity act, int state)
func_button::Trigger(entity act, triggermode_t state)
{
if (GetMaster() == FALSE)
return;

View File

@ -45,7 +45,7 @@ public:
virtual void Save(float);
virtual void Restore(string,string);
virtual void Respawn(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void Touch(entity);
virtual void SetMovementDirection(void);
virtual void Input(entity, string, string);
@ -143,7 +143,7 @@ func_conveyor::Touch(entity eToucher)
}
void
func_conveyor::Trigger(entity act, int state)
func_conveyor::Trigger(entity act, triggermode_t state)
{
switch (state) {
case TRIG_ON:

View File

@ -88,7 +88,7 @@ public:
virtual void Arrived(void);
virtual void Returned(void);
virtual void Respawn(void);
virtual void Trigger(entity, int);
virtual void Trigger(entity, triggermode_t);
virtual void Blocked(entity);
virtual void Touch(entity);
virtual void PlayerUse(void);
@ -560,7 +560,7 @@ func_door::MoveAway(void)
}
void
func_door::Trigger(entity act, int triggerstate)
func_door::Trigger(entity act, triggermode_t triggerstate)
{
if (GetMaster() == 0)
return;

View File

@ -104,7 +104,7 @@ public:
virtual void Returned(void);
virtual void Back(void);
virtual void Away(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void Use(void);
virtual void Touch(entity);
virtual void Blocked(entity);
@ -506,7 +506,7 @@ func_door_rotating::Away(void)
}
void
func_door_rotating::Trigger(entity act, int state)
func_door_rotating::Trigger(entity act, triggermode_t state)
{
if (GetMaster() == FALSE) {
return;

View File

@ -46,7 +46,7 @@ public:
virtual void SpawnKey(string,string);
virtual void Spawned(void);
virtual void Respawn(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void Death(void);
virtual void NextPath(void);
@ -227,7 +227,7 @@ func_guntarget::Stop(void)
}
void
func_guntarget::Trigger(entity act, int state)
func_guntarget::Trigger(entity act, triggermode_t state)
{
switch (state) {
case TRIG_OFF:

View File

@ -57,7 +57,7 @@ public:
/* overrides */
virtual void Save(float);
virtual void Restore(string,string);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void Respawn(void);
virtual void SpawnKey(string,string);
@ -228,7 +228,7 @@ func_mortar_field::FireControlled(void)
}
void
func_mortar_field::Trigger(entity act, int state)
func_mortar_field::Trigger(entity act, triggermode_t state)
{
switch (m_iType) {
case 0:

View File

@ -64,7 +64,7 @@ public:
virtual void Restore(string,string);
virtual void SpawnKey(string,string);
virtual void Respawn(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void customphysics(void);
};
@ -141,7 +141,7 @@ func_pendulum::Respawn(void)
}
void
func_pendulum::Trigger(entity act, int state)
func_pendulum::Trigger(entity act, triggermode_t state)
{
switch (state) {
case TRIG_OFF:

View File

@ -58,7 +58,7 @@ public:
virtual void Save(float);
virtual void Restore(string,string);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void Respawn(void);
virtual void Touch(entity);
virtual void SpawnKey(string,string);
@ -179,7 +179,7 @@ func_plat::MoveToggle(void)
}
void
func_plat::Trigger(entity act, int state)
func_plat::Trigger(entity act, triggermode_t state)
{
if (HasSpawnFlags(FNCPLAT_TRIGGER))
return;

View File

@ -61,7 +61,7 @@ public:
virtual void Save(float);
virtual void Restore(string,string);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void Respawn(void);
virtual void Touch(entity);
virtual void SpawnKey(string,string);
@ -222,7 +222,7 @@ func_platrot::MoveToggle(void)
}
void
func_platrot::Trigger(entity act, int state)
func_platrot::Trigger(entity act, triggermode_t state)
{
if (HasSpawnFlags(FNCPLAT_TRIGGER))
return;

View File

@ -79,7 +79,7 @@ public:
virtual void Restore(string,string);
virtual void SpawnKey(string,string);
virtual void Respawn(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void Rotate(void);
virtual void Blocked(entity);
@ -171,7 +171,7 @@ func_rotating::Respawn(void)
/* TODO: Handle state */
void
func_rotating::Trigger(entity act, int state)
func_rotating::Trigger(entity act, triggermode_t state)
{
if (vlen(avelocity) > 0) {
ClearVelocity();

View File

@ -69,7 +69,7 @@ public:
virtual void SpawnKey(string,string);
virtual void Spawned(void);
virtual void Respawn(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void SoundMove(void);
virtual void SoundStop(void);
@ -351,7 +351,7 @@ func_tracktrain::PathNext(void)
/* TODO: Handle state? */
void
func_tracktrain::Trigger(entity act, int state)
func_tracktrain::Trigger(entity act, triggermode_t state)
{
PathMove();
}

View File

@ -72,7 +72,7 @@ public:
virtual void SpawnKey(string,string);
virtual void Spawned(void);
virtual void Respawn(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void SoundMove(void);
virtual void SoundStop(void);
@ -304,7 +304,7 @@ func_train::PathNext(void)
/* TODO: Handle state? */
void
func_train::Trigger(entity act, int state)
func_train::Trigger(entity act, triggermode_t state)
{
PathMove();
}

View File

@ -44,7 +44,7 @@ public:
virtual void Save(float);
virtual void Restore(string,string);
virtual void Respawn(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void Input(entity,string,string);
};
@ -97,7 +97,7 @@ func_wall_toggle::Respawn(void)
}
void
func_wall_toggle::Trigger(entity act, int state)
func_wall_toggle::Trigger(entity act, triggermode_t state)
{
switch (state) {
case TRIG_OFF:

View File

@ -53,7 +53,7 @@ public:
/* overrides */
virtual void Save(float);
virtual void Restore(string,string);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void Respawn(void);
virtual void SpawnKey(string,string);
@ -133,7 +133,7 @@ game_counter::GetCount(void)
}
void
game_counter::Trigger(entity act, int state)
game_counter::Trigger(entity act, triggermode_t state)
{
if (GetMaster() == FALSE)
return;

View File

@ -46,7 +46,7 @@ public:
virtual void Save(float);
virtual void Restore(string,string);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void Respawn(void);
virtual void SpawnKey(string,string);
@ -96,7 +96,7 @@ game_counter_set::Respawn(void)
}
void
game_counter_set::Trigger(entity act, int state)
game_counter_set::Trigger(entity act, triggermode_t state)
{
if (GetMaster() == FALSE)
return;

View File

@ -56,7 +56,7 @@ public:
virtual void Save(float);
virtual void Restore(string,string);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void SpawnKey(string,string);
virtual void SpawnUnit(string,vector);
@ -136,7 +136,7 @@ game_player_equip::SpawnUnit(string cname, vector org)
}
void
game_player_equip::Trigger(entity act, int state)
game_player_equip::Trigger(entity act, triggermode_t state)
{
int total, i, count, x;
string cname;

View File

@ -66,7 +66,7 @@ public:
virtual void Save(float);
virtual void Restore(string,string);
virtual void SpawnKey(string,string);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
};
@ -180,7 +180,7 @@ game_text::SpawnKey(string strKey, string strValue)
}
void
game_text::Trigger(entity act, int state)
game_text::Trigger(entity act, triggermode_t state)
{
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EV_TEXT);

View File

@ -50,7 +50,7 @@ public:
virtual void SpawnKey(string,string);
virtual void Respawn(void);
virtual void Spawned(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
};
@ -134,7 +134,7 @@ infodecal::Respawn(void)
}
void
infodecal::Trigger(entity act, int state)
infodecal::Trigger(entity act, triggermode_t state)
{
switch (state) {
case TRIG_OFF:

View File

@ -84,7 +84,7 @@ public:
virtual void Spawned(void);
virtual void Respawn(void);
virtual void RestoreComplete(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
};
@ -215,7 +215,7 @@ light::Respawn(void)
}
void
light::Trigger(entity act, int state)
light::Trigger(entity act, triggermode_t state)
{
switch (state) {
case TRIG_OFF:

View File

@ -64,7 +64,7 @@ public:
virtual void Restore(string,string);
virtual void SpawnKey(string,string);
virtual void Respawn(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void Spawner(void);
virtual void TurnOn(void);
@ -263,7 +263,7 @@ monstermaker::Spawner(void)
}
void
monstermaker::Trigger(entity act, int state)
monstermaker::Trigger(entity act, triggermode_t state)
{
switch (state) {
case TRIG_OFF:

View File

@ -101,7 +101,7 @@ public:
virtual void SpawnKey(string,string);
virtual void Spawned(void);
virtual void Respawn(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
};
void
@ -287,7 +287,7 @@ multi_manager::Respawn(void)
}
void
multi_manager::Trigger(entity act, int state)
multi_manager::Trigger(entity act, triggermode_t state)
{
static void mm_enttrigger (void) {
multi_manager_sub wow = (multi_manager_sub)self;

View File

@ -38,7 +38,7 @@ public:
virtual void Respawn(void);
virtual int QueryTargets(void);
virtual int GetValue(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
};
@ -54,7 +54,7 @@ multisource::Respawn(void)
}
void
multisource::Trigger(entity act, int unused)
multisource::Trigger(entity act, triggermode_t unused)
{
if (QueryTargets() == FALSE) {
NSLog("[^1MULTISOURCE^7] %s is inactive.", targetname);

View File

@ -61,7 +61,7 @@ public:
virtual void Restore(string,string);
virtual void SpawnKey(string,string);
virtual void Respawn(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
};
@ -139,7 +139,7 @@ path_corner::Respawn(void)
}
void
path_corner::Trigger(entity act, int state)
path_corner::Trigger(entity act, triggermode_t state)
{
entity a;

View File

@ -47,7 +47,7 @@ public:
virtual void Save(float);
virtual void Restore(string,string);
virtual void SpawnKey(string,string);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void ReloadSave(void);
@ -121,7 +121,7 @@ player_loadsaved::ReloadSave(void)
}
void
player_loadsaved::Trigger(entity act, int unused)
player_loadsaved::Trigger(entity act, triggermode_t unused)
{
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EV_FADE);

View File

@ -30,7 +30,7 @@ player_weaponstrip:NSPointTrigger
public:
void player_weaponstrip(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
};
void
@ -39,7 +39,7 @@ player_weaponstrip::player_weaponstrip(void)
}
void
player_weaponstrip::Trigger(entity act, int unused)
player_weaponstrip::Trigger(entity act, triggermode_t unused)
{
NSClientPlayer pl;

View File

@ -54,7 +54,7 @@ public:
virtual void Restore(string,string);
virtual void SpawnKey(string,string);
virtual void Respawn(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void PlaySample(void);
virtual void Enable(void);
@ -130,7 +130,7 @@ random_speaker::Respawn(void)
}
void
random_speaker::Trigger(entity act, int state)
random_speaker::Trigger(entity act, triggermode_t state)
{
if (GetMaster() == FALSE)
return;

View File

@ -46,7 +46,7 @@ public:
virtual void Restore(string,string);
virtual void SpawnKey(string,string);
virtual void Respawn(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
};
@ -119,7 +119,7 @@ random_trigger::Respawn(void)
}
void
random_trigger::Trigger(entity act, int state)
random_trigger::Trigger(entity act, triggermode_t state)
{
float r;

View File

@ -49,7 +49,7 @@ public:
virtual void Save(float);
virtual void Restore(string,string);
virtual void SpawnKey(string,string);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
};
@ -128,7 +128,7 @@ scripted_sentence::SpawnKey(string strKey, string strValue)
}
void
scripted_sentence::Trigger(entity act, int unused)
scripted_sentence::Trigger(entity act, triggermode_t unused)
{
entity spe;
spe = find(world, ::targetname, m_strSpeaker);

View File

@ -103,7 +103,7 @@ public:
/* overrides */
virtual void Save(float);
virtual void Restore(string,string);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void Respawn(void);
virtual void SpawnKey(string,string);
@ -315,7 +315,7 @@ scripted_sequence::RunOnEntity(entity targ)
}
void
scripted_sequence::Trigger(entity act, int unused)
scripted_sequence::Trigger(entity act, triggermode_t unused)
{
NSMonster f;

View File

@ -78,7 +78,7 @@ public:
virtual void Restore(string,string);
virtual void SpawnKey(string,string);
virtual void Respawn(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void Announce(void);
@ -170,7 +170,7 @@ speaker::Announce(void)
}
void
speaker::Trigger(entity eAct, int foo)
speaker::Trigger(entity eAct, triggermode_t foo)
{
ScheduleThink(Announce, 0.0f);
}

View File

@ -46,7 +46,7 @@ public:
virtual void Restore(string,string);
virtual void SpawnKey(string,string);
virtual void Respawn(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
};
@ -102,7 +102,7 @@ targ_speaker::Respawn(void)
}
void
targ_speaker::Trigger(entity act, int state)
targ_speaker::Trigger(entity act, triggermode_t state)
{
if (GetMaster() == FALSE)
return;

View File

@ -37,7 +37,7 @@ This entity was introduced in Half-Life (1998).
class
trigger_auto:NSPointTrigger
{
int m_iTriggerState;
triggermode_t m_iTriggerState;
float m_flDelay;
public:
@ -66,7 +66,7 @@ void
trigger_auto::Save(float handle)
{
super::Save(handle);
SaveInt(handle, "m_iTriggerState", m_iTriggerState);
SaveFloat(handle, "m_iTriggerState", m_iTriggerState);
SaveFloat(handle, "m_flDelay", m_flDelay);
}
@ -75,7 +75,7 @@ trigger_auto::Restore(string strKey, string strValue)
{
switch (strKey) {
case "m_iTriggerState":
m_iTriggerState = ReadInt(strValue);
m_iTriggerState = ReadFloat(strValue);
break;
case "m_flDelay":
m_flDelay = ReadFloat(strValue);
@ -88,7 +88,7 @@ trigger_auto::Restore(string strKey, string strValue)
void
trigger_auto::RestoreComplete(void)
{
ScheduleThink(Processing, 0.25f);
//ScheduleThink(Processing, 0.0f);
}
void
@ -96,7 +96,7 @@ trigger_auto::SpawnKey(string strKey, string strValue)
{
switch (strKey) {
case "triggerstate":
m_iTriggerState = stoi(strValue);
m_iTriggerState = stof(strValue);
break;
case "delay":
m_flDelay = stof(strValue);
@ -111,22 +111,42 @@ trigger_auto::Respawn(void)
{
InitPointTrigger();
/* deliberately add a bit more time in case we're first in the ent-lump */
ScheduleThink(Processing, 0.25f);
/* deliberately add a bit more time in case we're first in the ent-lump
also we'll only do this in multiplayer games. SP games will call
trigger_auto_trigger() for when one player has fully joined */
if (cvar("sv_playerslots") > 1)
ScheduleThink(Processing, 0.25f);
}
void
trigger_auto::Processing(void)
{
if (m_strGlobalState)
if (m_strGlobalState) {
if (GetGlobalValue(m_strGlobalState) == 0)
return;
}
UseTargets(this, m_iTriggerState, m_flDelay);
print(sprintf("%S %i %f\n", target, m_iTriggerState, m_flDelay));
print(sprintf("%S %d %f %f\n", target, m_iTriggerState, m_flDelay, time));
if (HasSpawnFlags(1)) {
NSLog("^2trigger_auto::^3Processing^7: %s triggerer removed self", target);
Destroy();
}
}
void
trigger_auto_trigger(void)
{
static bool called = false;
trigger_auto loop;
/* don't do it more than once */
if (called)
return;
for (loop = __NULL__; (loop = (trigger_auto)find(loop, ::classname, "trigger_auto"));) {
loop.Processing();
}
called = true;
}

View File

@ -38,7 +38,7 @@ public:
virtual void Restore(string,string);
virtual void SpawnKey(string,string);
virtual void Respawn(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void Touch(entity);
};
@ -88,7 +88,7 @@ trigger_cdaudio::Respawn(void)
}
void
trigger_cdaudio::Trigger(entity act, int unused)
trigger_cdaudio::Trigger(entity act, triggermode_t unused)
{
if (!(act.flags & FL_CLIENT)) {
return;

View File

@ -89,7 +89,7 @@ public:
virtual void SpawnKey(string,string);
virtual void Spawned(void);
virtual void Respawn(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void Input(entity,string,string);
virtual void Change(void);
@ -249,7 +249,7 @@ trigger_changelevel::Change(void)
}
void
trigger_changelevel::Trigger(entity act, int unused)
trigger_changelevel::Trigger(entity act, triggermode_t unused)
{
if (GetMaster() == FALSE)
return;

View File

@ -38,7 +38,7 @@ public:
virtual void Save(float);
virtual void Restore(string,string);
virtual void SpawnKey(string,string);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
};
@ -80,7 +80,7 @@ trigger_changetarget::SpawnKey(string strKey, string strValue)
}
void
trigger_changetarget::Trigger(entity act, int state)
trigger_changetarget::Trigger(entity act, triggermode_t state)
{
NSEntity f;

View File

@ -49,7 +49,7 @@ public:
virtual void Restore(string,string);
virtual void SpawnKey(string,string);
virtual void Respawn(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void Touch(entity);
};
@ -105,7 +105,7 @@ trigger_counter::Respawn(void)
}
void
trigger_counter::Trigger(entity act, int state)
trigger_counter::Trigger(entity act, triggermode_t state)
{
if (act.classname == "func_pushable" && !HasSpawnFlags(TRCNT_PUSHABLES))
return;

View File

@ -31,7 +31,7 @@ trigger_endsection:NSBrushTrigger
public:
void trigger_endsection(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void Respawn(void);
};
@ -48,7 +48,7 @@ trigger_endsection::Respawn(void)
}
void
trigger_endsection::Trigger(entity act, int state)
trigger_endsection::Trigger(entity act, triggermode_t state)
{
if (GetMaster() == FALSE)
return;

View File

@ -74,7 +74,7 @@ public:
virtual void Spawned(void);
virtual void Save(float);
virtual void Restore(string,string);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void Touch(entity);
virtual void Respawn(void);
virtual void SpawnKey(string,string);
@ -194,7 +194,7 @@ trigger_hurt::Respawn(void)
}
void
trigger_hurt::Trigger(entity act, int state)
trigger_hurt::Trigger(entity act, triggermode_t state)
{
switch (state) {
case TRIG_OFF:

View File

@ -43,9 +43,9 @@ class trigger_once:NSBrushTrigger
{
public:
void trigger_once(void);
/* overrides */
virtual void Spawned(void);
virtual void Save(float);
virtual void Restore(string,string);
virtual void Touch(entity);
@ -64,6 +64,25 @@ trigger_once::trigger_once(void)
m_strOnTrigger = __NULL__;
}
void
trigger_once::Spawned(void)
{
super::Spawned();
if (m_strOnTrigger)
m_strOnTrigger = CreateOutput(m_strOnTrigger);
if (m_strOnStartTouch)
m_strOnStartTouch = CreateOutput(m_strOnStartTouch);
}
void
trigger_once::Respawn(void)
{
InitBrushTrigger();
m_iValue = 0;
}
void
trigger_once::Save(float handle)
{
@ -102,26 +121,6 @@ trigger_once::SpawnKey(string strKey, string strValue)
break;
}
}
void
trigger_once::Spawned(void)
{
super::Spawned();
if (m_strOnTrigger)
m_strOnTrigger = CreateOutput(m_strOnTrigger);
if (m_strOnStartTouch)
m_strOnStartTouch = CreateOutput(m_strOnStartTouch);
}
void
trigger_once::Respawn(void)
{
InitBrushTrigger();
m_iValue = 0;
}
void
trigger_once::Touch(entity eToucher)
{

View File

@ -37,7 +37,7 @@ public:
void trigger_playerfreeze(void);
virtual void Respawn(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void customphysics(void);
};
@ -53,7 +53,7 @@ trigger_playerfreeze::Respawn(void)
}
void
trigger_playerfreeze::Trigger(entity act, int state)
trigger_playerfreeze::Trigger(entity act, triggermode_t state)
{
if (GetMaster() == FALSE)
return;

View File

@ -46,7 +46,7 @@ public:
virtual void Restore(string,string);
virtual void SpawnKey(string,string);
virtual void Respawn(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity,triggermode_t);
virtual void Touch(entity);
virtual void SetMovementDirection(void);
@ -112,7 +112,7 @@ trigger_push::Respawn(void)
}
void
trigger_push::Trigger(entity act, int state)
trigger_push::Trigger(entity act, triggermode_t state)
{
switch (state) {
case TRIG_OFF:

View File

@ -41,13 +41,13 @@ class
trigger_relay:NSPointTrigger
{
private:
int m_iTriggerState;
triggermode_t m_iTriggerState;
int m_iEnabled;
public:
void trigger_relay(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity,triggermode_t);
virtual void Respawn(void);
virtual void SpawnKey(string,string);
@ -58,7 +58,7 @@ public:
void
trigger_relay::trigger_relay(void)
{
m_iTriggerState =
m_iTriggerState = 0;
m_iEnabled = 0;
}
@ -66,7 +66,7 @@ void
trigger_relay::Save(float handle)
{
super::Save(handle);
SaveInt(handle, "m_iTriggerState", m_iTriggerState);
SaveFloat(handle, "m_iTriggerState", m_iTriggerState);
SaveInt(handle, "m_iEnabled", m_iEnabled);
}
@ -75,7 +75,7 @@ trigger_relay::Restore(string strKey, string strValue)
{
switch (strKey) {
case "m_iTriggerState":
m_iTriggerState = ReadInt(strValue);
m_iTriggerState = ReadFloat(strValue);
break;
case "m_iEnabled":
m_iEnabled = ReadInt(strValue);
@ -101,15 +101,22 @@ void
trigger_relay::Respawn(void)
{
m_iEnabled = TRUE;
m_iValue = FALSE;
}
void
trigger_relay::Trigger(entity act, int state)
trigger_relay::Trigger(entity act, triggermode_t state)
{
if (m_iEnabled == FALSE)
if (m_iEnabled == FALSE) {
NSLog("trigger_relay (%s) has already been triggered", targetname);
return;
if (HasSpawnFlags(TRLY_ONCE))
m_iEnabled = FALSE;
}
if (HasSpawnFlags(TRLY_ONCE)) {
m_iEnabled = FALSE;
}
m_iValue = TRUE;
NSLog("trigger_relay (%s) will trigger %s with state %d", targetname, target, m_iTriggerState);
UseTargets(act, m_iTriggerState, m_flDelay);
}

View File

@ -74,8 +74,8 @@ public:
virtual void Respawn(void);
virtual void EvaluateEntity(void);
virtual float SendEntity(entity,float);
virtual void UseNormal(entity,int);
virtual void UseLoop(entity,int);
virtual void UseNormal(entity,triggermode_t);
virtual void UseLoop(entity, triggermode_t);
#else
virtual void ReceiveEntity(float,float);
virtual float predraw(void);
@ -258,7 +258,7 @@ ambient_generic::Respawn(void)
}
void
ambient_generic::UseNormal(entity act, int state)
ambient_generic::UseNormal(entity act, triggermode_t state)
{
NSLog("Sound once: %S Volume: %f; Radius: %d; Pitch: %d", \
m_strActivePath, m_flVolume, m_flRadius, m_flPitch);
@ -280,7 +280,7 @@ ambient_generic::UseNormal(entity act, int state)
}
void
ambient_generic::UseLoop(entity act, int state)
ambient_generic::UseLoop(entity act, triggermode_t state)
{
if (m_bToggle == TRUE) {
NSLog("^2ambient_generic::^3UseLoop^7: %s stops `%s`",
@ -311,12 +311,12 @@ ambient_generic::EvaluateEntity(void)
if (ATTR_CHANGED(m_bLoops))
SetSendFlags(AMBIENT_ENABLED);
SAVE_STATE(origin);
SAVE_STATE(m_strActivePath);
SAVE_STATE(m_flVolume);
SAVE_STATE(m_flRadius);
SAVE_STATE(m_flPitch);
SAVE_STATE(m_bLoops);
SAVE_STATE(origin)
SAVE_STATE(m_strActivePath)
SAVE_STATE(m_flVolume)
SAVE_STATE(m_flRadius)
SAVE_STATE(m_flPitch)
SAVE_STATE(m_bLoops)
}
float

View File

@ -85,7 +85,7 @@ public:
virtual void SpawnKey(string,string);
virtual void EvaluateEntity(void);
virtual float SendEntity(entity,float);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
nonvirtual void CastLaser(void);
nonvirtual void LaunchBeam(void);
nonvirtual void EndBeam(void);
@ -258,7 +258,7 @@ env_beam::StopBeam(void)
}
void
env_beam::Trigger(entity act, int state)
env_beam::Trigger(entity act, triggermode_t state)
{
/* if toggle isn't enabled, it can only ever get activated */
if (m_flLifeTime > 0 && HasSpawnFlags(BEAM_TOGGLE) == false) {
@ -429,10 +429,10 @@ env_beam::predraw(void)
{
/* only draw when active. */
if (!m_iActive)
return;
return (PREDRAW_NEXT);
if (autocvar(r_skipBeams, 0))
return;
return (PREDRAW_NEXT);
/* primitive representation */
#if 0
@ -452,7 +452,6 @@ env_beam::predraw(void)
float progression = (i / (BEAM_COUNT-1));
vector point;
vector jitter;
float strength;
float a = 1.0f;
/* our steps from a - b */

View File

@ -81,7 +81,7 @@ public:
virtual void Restore(string,string);
virtual void EvaluateEntity(void);
virtual float SendEntity(entity,float);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void Input(entity,string,string);
#else
virtual void EmitBubbles(void);
@ -167,7 +167,7 @@ env_bubbles::Input(entity eAct, string strKey, string strData)
}
void
env_bubbles::Trigger(entity eAct, int iState)
env_bubbles::Trigger(entity eAct, triggermode_t iState)
{
switch (iState) {
case TRIG_OFF:
@ -196,12 +196,12 @@ env_bubbles::EvaluateEntity(void)
if (ATTR_CHANGED(m_bEnabled))
SetSendFlags(BUBBLES_ENABLED);
SAVE_STATE(origin);
SAVE_STATE(angles);
SAVE_STATE(m_iDensity);
SAVE_STATE(m_flFrequency);
SAVE_STATE(m_flCurrent);
SAVE_STATE(m_bEnabled);
SAVE_STATE(origin)
SAVE_STATE(angles)
SAVE_STATE(m_iDensity)
SAVE_STATE(m_flFrequency)
SAVE_STATE(m_flCurrent)
SAVE_STATE(m_bEnabled)
}
float
env_bubbles::SendEntity(entity ePVSent, float flChanged)

View File

@ -109,7 +109,7 @@ public:
#else
virtual float SendEntity(entity,float);
virtual void EvaluateEntity(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void Respawn(void);
virtual void Save(float);
virtual void Restore(string,string);
@ -303,19 +303,19 @@ env_fog_controller::EvaluateEntity(void)
if (ATTR_CHANGED(m_vecFogDir))
SetSendFlags(ENVFOG_CHANGED_DIR);
SAVE_STATE(m_iFogActive);
SAVE_STATE(m_iFogBlend);
SAVE_STATE(m_flFogStart);
SAVE_STATE(m_flFogEnd);
SAVE_STATE(m_flFogMaxDensity);
SAVE_STATE(m_flFogFarZ);
SAVE_STATE(m_vecFogColor);
SAVE_STATE(m_vecFogColor2);
SAVE_STATE(m_vecFogDir);
SAVE_STATE(m_iFogActive)
SAVE_STATE(m_iFogBlend)
SAVE_STATE(m_flFogStart)
SAVE_STATE(m_flFogEnd)
SAVE_STATE(m_flFogMaxDensity)
SAVE_STATE(m_flFogFarZ)
SAVE_STATE(m_vecFogColor)
SAVE_STATE(m_vecFogColor2)
SAVE_STATE(m_vecFogDir)
}
void
env_fog_controller::Trigger(entity eAct, int iState)
env_fog_controller::Trigger(entity eAct, triggermode_t iState)
{
switch (iState) {
case TRIG_OFF:

View File

@ -73,7 +73,7 @@ public:
virtual void SpawnKey(string,string);
virtual void EvaluateEntity(void);
virtual float SendEntity(entity,float);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
nonvirtual void CastLaser(void);
#else
virtual float predraw(void);
@ -176,7 +176,7 @@ env_laser::CastLaser(void)
}
void
env_laser::Trigger(entity act, int state)
env_laser::Trigger(entity act, triggermode_t state)
{
switch (state) {
case TRIG_OFF:
@ -317,10 +317,10 @@ env_laser::predraw(void)
{
/* only draw when active. */
if (!m_iActive)
return;
return (PREDRAW_NEXT);
if (autocvar(r_skipBeams, 0))
return;
return (PREDRAW_NEXT);
/* primitive representation */
#if 0
@ -340,7 +340,6 @@ env_laser::predraw(void)
float progression = (i / (LASER_COUNT-1));
vector point;
vector jitter;
float strength;
float a = 1.0f;
/* our steps from a - b */

View File

@ -84,7 +84,7 @@ public:
virtual void ReceiveEntity(float,float);
virtual float predraw(void);
#else
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void Respawn(void);
virtual float SendEntity(entity,float);
virtual void SpawnKey(string,string);
@ -166,12 +166,12 @@ env_projectedtexture::EvaluateEntity(void)
SetSendFlags(PRTEXFL_CHANGED_ANGLES);
}
SAVE_STATE(origin);
SAVE_STATE(angles);
SAVE_STATE(origin)
SAVE_STATE(angles)
}
void
env_projectedtexture::Trigger(entity act, int state)
env_projectedtexture::Trigger(entity act, triggermode_t state)
{
switch (state) {
case TRIG_OFF:

View File

@ -81,7 +81,7 @@ public:
#ifdef SERVER
virtual void Spawned(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void EvaluateEntity(void);
virtual float SendEntity(entity,float);
virtual void SpawnKey(string,string);
@ -125,15 +125,15 @@ env_sprite::EvaluateEntity(void)
SetSendFlags(SPRITE_CHANGED_MATERIAL);
}
SAVE_STATE(origin);
SAVE_STATE(modelindex);
SAVE_STATE(m_flFramerate);
SAVE_STATE(scale);
SAVE_STATE(m_iRenderMode);
SAVE_STATE(m_iRenderFX);
SAVE_STATE(m_vecRenderColor);
SAVE_STATE(m_flRenderAmt);
SAVE_STATE(m_strMaterial);
SAVE_STATE(origin)
SAVE_STATE(modelindex)
SAVE_STATE(m_flFramerate)
SAVE_STATE(scale)
SAVE_STATE(m_iRenderMode)
SAVE_STATE(m_iRenderFX)
SAVE_STATE(m_vecRenderColor)
SAVE_STATE(m_flRenderAmt)
SAVE_STATE(m_strMaterial)
}
float
@ -213,7 +213,7 @@ env_sprite::NetworkOnce(void)
/* TODO: Implement state */
void
env_sprite::Trigger(entity act, int state)
env_sprite::Trigger(entity act, triggermode_t state)
{
if (HasSpawnFlags(ENVS_PLAYONCE)) {
NetworkOnce();

View File

@ -36,7 +36,7 @@ public:
#ifdef SERVER
virtual void Respawn(void);
virtual float SendEntity(entity,float);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
#else
virtual void Init(void);
#endif
@ -56,7 +56,7 @@ func_illusionary::SendEntity(entity pvsent, float fl)
}
void
func_illusionary::Trigger(entity act, int state)
func_illusionary::Trigger(entity act, triggermode_t state)
{
switch (state) {
case TRIG_OFF:

View File

@ -33,14 +33,14 @@ public:
virtual void Respawn(void);
#ifdef SERVER
virtual void Trigger(entity, int);
virtual void Trigger(entity, triggermode_t);
#endif
};
#ifdef SERVER
void
func_ladder::Trigger(entity act, int state)
func_ladder::Trigger(entity act, triggermode_t state)
{
switch (state) {
case TRIG_OFF:

View File

@ -99,7 +99,7 @@ public:
virtual void EvaluateEntity(void);
virtual float SendEntity(entity,float);
virtual void SpawnKey(string,string);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void Input(entity, string, string);
#endif
};
@ -225,7 +225,7 @@ func_monitor::EvaluateEntity(void)
if (ATTR_CHANGED(origin)) {
SetSendFlags(MONITORFL_CHANGED_BASE);
}
SAVE_STATE(origin);
SAVE_STATE(origin)
/* this monitor is disabled */
if (!m_iValue)
@ -276,7 +276,7 @@ func_monitor::EvaluateEntity(void)
}
void
func_monitor::Trigger(entity act, int state)
func_monitor::Trigger(entity act, triggermode_t state)
{
switch (state) {
case TRIG_OFF:

View File

@ -36,7 +36,7 @@ public:
#ifdef SERVER
virtual void Respawn(void);
virtual float SendEntity(entity,float);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
#else
virtual void Init(void);
#endif
@ -57,7 +57,7 @@ func_wall::SendEntity(entity pvsent, float fl)
}
void
func_wall::Trigger(entity act, int state)
func_wall::Trigger(entity act, triggermode_t state)
{
switch (state) {
case TRIG_OFF:

View File

@ -67,7 +67,7 @@ public:
virtual void EvaluateEntity(void);
virtual float SendEntity(entity,float);
virtual void SpawnKey(string,string);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void Input(entity, string, string);
#endif
};
@ -172,12 +172,12 @@ info_particle_system::EvaluateEntity(void)
SetSendFlags(PARTSYSFL_CHANGED_ANGLES);
}
SAVE_STATE(origin);
SAVE_STATE(angles);
SAVE_STATE(origin)
SAVE_STATE(angles)
}
void
info_particle_system::Trigger(entity act, int state)
info_particle_system::Trigger(entity act, triggermode_t state)
{
switch (state) {
case TRIG_OFF:

View File

@ -94,7 +94,7 @@ public:
virtual void RendererRestarted(void);
virtual void LightChanged(float);
#else
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void Respawn(void);
virtual float SendEntity(entity,float);
virtual void EvaluateEntity(void);
@ -236,12 +236,12 @@ light_dynamic::EvaluateEntity(void)
SetSendFlags(DLIGHTFL_CHANGED_ANGLES);
}
SAVE_STATE(origin);
SAVE_STATE(angles);
SAVE_STATE(origin)
SAVE_STATE(angles)
}
void
light_dynamic::Trigger(entity act, int state)
light_dynamic::Trigger(entity act, triggermode_t state)
{
switch (state) {
case TRIG_OFF:

View File

@ -232,12 +232,12 @@ prop_rope::EvaluateEntity(void)
SetSendFlags(PROPROPE_CHANGED_FLAGS);
}
SAVE_STATE(m_flSag);
SAVE_STATE(m_flSwingFactor);
SAVE_STATE(m_iSegments);
SAVE_STATE(origin);
SAVE_STATE(m_vecTarget);
SAVE_STATE(flags);
SAVE_STATE(m_flSag)
SAVE_STATE(m_flSwingFactor)
SAVE_STATE(m_iSegments)
SAVE_STATE(origin)
SAVE_STATE(m_vecTarget)
SAVE_STATE(flags)
}
float

View File

@ -838,13 +838,13 @@ prop_vehicle_driveable::EvaluateEntity(void)
if (ATTR_CHANGED(flags))
SetSendFlags(VEHFL_FLAGS);
SAVE_STATE(origin);
SAVE_STATE(angles);
SAVE_STATE(modelindex);
SAVE_STATE(velocity);
SAVE_STATE(m_flTurn);
SAVE_STATE(m_eDriver);
SAVE_STATE(flags);
SAVE_STATE(origin)
SAVE_STATE(angles)
SAVE_STATE(modelindex);
SAVE_STATE(velocity)
SAVE_STATE(m_flTurn)
SAVE_STATE(m_eDriver)
SAVE_STATE(flags)
}
float

View File

@ -59,7 +59,7 @@ public:
#else
virtual void NextPath(void);
virtual void GoToTarget(void);
virtual void Trigger(entity,int);
virtual void Trigger(entity, triggermode_t);
virtual void Respawn(void);
virtual void SpawnKey(string,string);
virtual float SendEntity(entity,float);
@ -190,8 +190,8 @@ trigger_camera::EvaluateEntity(void)
SetSendFlags(OCAMFL_CHANGED_ANGLES);
}
SAVE_STATE(origin);
SAVE_STATE(angles);
SAVE_STATE(origin)
SAVE_STATE(angles)
}
void
@ -258,7 +258,7 @@ trigger_camera::NextPath(void)
/* TODO: Handle state? */
void
trigger_camera::Trigger(entity act, int state)
trigger_camera::Trigger(entity act, triggermode_t state)
{
m_eLooker = act;
NSLog("Triggering it on %s\n", act.netname);

View File

@ -152,6 +152,8 @@ PutClientInServer(void)
if (t.Trigger)
t.Trigger(self, TRIG_TOGGLE);
}
trigger_auto_trigger();
}
/** Run before game physics have taken place.

View File

@ -25,6 +25,9 @@ class NSBrushTrigger:NSEntity
public:
void NSBrushTrigger(void);
/* overrides */
virtual int GetValue(void);
/** Sets up a brush trigger volume based on the brush information. */
virtual void InitBrushTrigger(void);
nonvirtual void InitBrushTrigger(void);
};

View File

@ -19,6 +19,16 @@ NSBrushTrigger::NSBrushTrigger(void)
{
}
int
NSBrushTrigger::GetValue(void)
{
if (GetSolid() == SOLID_NOT) {
return (1);
}
return (0);
}
void
NSBrushTrigger::InitBrushTrigger(void)
{

View File

@ -45,7 +45,7 @@ NSClientPlayer::IsPlayer(void)
bool
NSClientPlayer::IsFakeSpectator(void)
{
if (GetFlags() & FL_FAKESPEC)
if (HasFlags(FL_FAKESPEC))
return (true);
return (false);
@ -199,7 +199,7 @@ NSClientPlayer::predraw(void)
RenderFire();
/* if we're inside of a vehicle, it may want to hide or show us regardless */
if (localplayer && flags & FL_INVEHICLE) {
if (localplayer && HasFlags(FL_INVEHICLE)) {
NSVehicle veh = (NSVehicle)vehicle;
if (veh)
@ -1004,7 +1004,7 @@ NSClientPlayer::InputUse_Down(void)
last_used = eRad;
/* Some entities want to support Use spamming */
if (!(flags & FL_USE_RELEASED)) {
if (HasFlags(FL_USE_RELEASED) == false) {
sound(this, CHAN_ITEM, "common/wpn_select.wav", 0.25, ATTN_IDLE);
}
} else {
@ -1023,7 +1023,7 @@ Called when we let go of the +use button
void
NSClientPlayer::InputUse_Up(void)
{
if (!(flags & FL_USE_RELEASED)) {
if (HasFlags(FL_USE_RELEASED) == false) {
_NSClientPlayer_unuseworkaround(last_used);
last_used = world;
flags |= FL_USE_RELEASED;
@ -1073,7 +1073,7 @@ NSClientPlayer::Footsteps_Update(void)
step_time = time + 2.0f;
} else {
/* make it so we step once we land */
if (!(GetFlags() & FL_ONGROUND) && !(GetFlags() & FL_ONLADDER)) {
if (HasFlags(FL_ONGROUND | FL_ONLADDER) == false) {
step_time = 0.0f;
return;
}
@ -1086,9 +1086,10 @@ NSClientPlayer::Footsteps_Update(void)
traceline(origin + view_ofs, origin + [0,0,-48], MOVE_NORMAL, this);
tex_name = getsurfacetexture(trace_ent, getsurfacenearpoint(trace_ent, trace_endpos));
if (!(GetFlags() & FL_ONGROUND) && (!GetFlags() & FL_ONLADDER)) {
/* don't step in air */
if (HasFlags(FL_ONGROUND | FL_ONLADDER) == false) {
return;
} else if (GetFlags() & FL_ONLADDER) {
} else if (HasFlags(FL_ONLADDER) && HasFlags(FL_ONGROUND) == false) { /* play ladder sounds */
if (step)
StartSoundDef("step_ladder.left", CHAN_BODY, true);
else
@ -1097,6 +1098,8 @@ NSClientPlayer::Footsteps_Update(void)
/* switch between feet */
step = 1 - step;
return;
} else if (HasFlags(FL_ONLADDER) && HasFlags(FL_ONGROUND)) { /* at a ladder, but not moving */
return;
}
if (step) {

View File

@ -259,6 +259,8 @@ public:
nonvirtual vector GetAbsoluteMaxs(void);
/** Returns a flag bitfield that the entity associates with. */
nonvirtual float GetFlags(void);
/** Returns true if the entity has the specified flags. */
nonvirtual float HasFlags(float);
/** Returns an absolute value of when the entity will be think again.
Any result should be tested against `::GetTime()`. */
nonvirtual float GetNextThinkTime(void);

View File

@ -595,6 +595,13 @@ float NSEntity::GetFlags( void ) {
return ( flags );
}
bool NSEntity::HasFlags(float bits) {
if ( flags & bits )
return (true);
return (false);
}
float NSEntity::GetNextThinkTime( void ) {
return ( nextthink );
}

View File

@ -146,18 +146,18 @@ NSPhysicsEntity::EvaluateEntity(void)
SetSendFlags(PHYENT_CHANGED_VELOCITY);
}
SAVE_STATE(origin);
SAVE_STATE(angles);
SAVE_STATE(modelindex);
SAVE_STATE(solid);
SAVE_STATE(movetype);
SAVE_STATE(size);
SAVE_STATE(frame);
SAVE_STATE(skin);
SAVE_STATE(effects);
SAVE_STATE(m_iBody);
SAVE_STATE(scale);
SAVE_STATE(velocity);
SAVE_STATE(origin)
SAVE_STATE(angles)
SAVE_STATE(modelindex)
SAVE_STATE(solid)
SAVE_STATE(movetype)
SAVE_STATE(size)
SAVE_STATE(frame)
SAVE_STATE(skin)
SAVE_STATE(effects)
SAVE_STATE(m_iBody)
SAVE_STATE(scale)
SAVE_STATE(velocity)
if (ATTR_CHANGED(m_iRenderMode)) {
SetSendFlags(PHYENT_CHANGED_RENDERMODE);

View File

@ -26,5 +26,5 @@ public:
void NSPointTrigger(void);
/** Sets up a point entity trigger with no size. */
virtual void InitPointTrigger(void);
nonvirtual void InitPointTrigger(void);
};

View File

@ -31,36 +31,25 @@ typedef enum
GLOBAL_DEAD
} globalstate_t;
typedef enum
{
USE_TOGGLE,
USE_CONTINOUS
} usetype_t;
typedef enum
{
TRIG_OFF,
TRIG_ON,
TRIG_TOGGLE
} triggermode_t;
/** NSTrigger handles all the non-input as well as Legacy (Quake, GoldSource) style
trigger behaviour. It also deals with masters, touches, blocking and so on.
*/
class NSTrigger:NSIO
{
private:
/* not needed to be saved right now */
float m_flTouchTime;
bool m_beingTouched;
entity m_eTouchLast;
nonvirtual void _TouchHandler(void);
nonvirtual void _BlockedHandler(void);
#ifdef SERVER
string m_oldstrTarget; /* needed due to trigger_changetarget */
string m_strGlobalState;
string m_strKillTarget;
string m_strMessage;
string m_strMaster;
int m_iUseType;
int m_iValue;
/* legacy trigger architecture */
float m_flDelay;
#else
float team;
#endif
public:
void NSTrigger(void);
@ -87,19 +76,19 @@ public:
virtual void Input(entity,string,string);
/** Called whenever we're legacy triggered by another object or function. */
virtual void Trigger(entity,int);
/** When called will trigger its legacy targets with a given delay. */
nonvirtual void UseTargets(entity,int, float);
/** Sets the legacy target for this entity. */
nonvirtual void SetTriggerTarget(string);
virtual void Trigger(entity, triggermode_t);
/* 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);
/** When called will trigger its legacy targets with a given delay. */
nonvirtual void UseTargets(entity,int,float);
/** Sets the legacy target for this entity. */
nonvirtual void SetTriggerTarget(string);
/** Returns whether our master allows us to be triggered. */
nonvirtual int GetMaster(void);
@ -120,19 +109,30 @@ public:
/** Retrives the team value of a given entity. */
nonvirtual float GetTeam(void);
#endif
};
enum
{
USE_TOGGLE,
USE_CONTINOUS
};
private:
/* not needed to be saved right now */
float m_flTouchTime;
bool m_beingTouched;
entity m_eTouchLast;
enum
{
TRIG_OFF,
TRIG_ON,
TRIG_TOGGLE
};
nonvirtual void _TouchHandler(void);
nonvirtual void _BlockedHandler(void);
#ifdef SERVER
string m_oldstrTarget; /* needed due to trigger_changetarget */
string m_strGlobalState;
string m_strKillTarget;
string m_strMessage;
string m_strMaster;
int m_iUseType;
int m_iValue;
/* legacy trigger architecture */
float m_flDelay;
#else
float team;
#endif
};

View File

@ -36,7 +36,7 @@ NSTrigger::NSTrigger(void)
#ifdef SERVER
/* legacy trigger architecture */
void
NSTrigger::Trigger(entity act, int state)
NSTrigger::Trigger(entity act, triggermode_t state)
{
NSLog("^2%s::^3Input^7: Triggerd by %s with no consequence",
classname, act.classname);