2
0
mirror of https://github.com/rehlds/reapi.git synced 2024-12-28 15:45:31 +03:00

StartDeathCam() immediately when changing team to spectator via rg_set_user_team (#81)

* StartDeathCam() immediately when changing team to spectator via rg_set_user_team
This commit is contained in:
In-line 2017-10-03 15:42:11 +04:00 committed by Dmitry Novikov
parent 9cedc733b7
commit b67d82af85
10 changed files with 57 additions and 33 deletions

View File

@ -27,23 +27,36 @@
*/
#pragma once
#define SF_PENDULUM_SWING 2 // spawnflag that makes a pendulum a rope swing.
// func_rotating
#define SF_BRUSH_ROTATE_Y_AXIS 0
#define SF_BRUSH_ROTATE_INSTANT 1
#define SF_BRUSH_ROTATE_BACKWARDS 2
#define SF_BRUSH_ROTATE_Z_AXIS 4
#define SF_BRUSH_ROTATE_X_AXIS 8
#define SF_BRUSH_ACCDCC 16 // brush should accelerate and decelerate when toggled
#define SF_BRUSH_HURT 32 // rotating brush that inflicts pain based on rotation speed
#define SF_ROTATING_NOT_SOLID 64 // some special rotating objects are not solid.
#define SF_BRUSH_ACCDCC 16 // brush should accelerate and decelerate when toggled
#define SF_BRUSH_HURT 32 // rotating brush that inflicts pain based on rotation speed
#define SF_WALL_START_OFF 0x0001
#define SF_ROTATING_NOT_SOLID 64 // some special rotating objects are not solid.
#define SF_CONVEYOR_VISUAL 0x0001
#define SF_CONVEYOR_NOTSOLID 0x0002
#define SF_BRUSH_ROTATE_SMALLRADIUS 128
#define SF_BRUSH_ROTATE_MEDIUMRADIUS 256
#define SF_BRUSH_ROTATE_LARGERADIUS 512
#define SF_WORLD_DARK 0x0001 // Fade from black at startup
#define SF_WORLD_TITLE 0x0002 // Display game title at startup
#define SF_WORLD_FORCETEAM 0x0004 // Force teams
#define FANPITCHMIN 30
#define FANPITCHMAX 100
#define FANPITCHMIN 30
#define FANPITCHMAX 100
// func_pendulum
#define SF_PENDULUM_SWING 2 // spawnflag that makes a pendulum a rope swing.
#define SF_PENDULUM_AUTO_RETURN 16
#define SF_PENDULUM_PASSABLE 32
// func_wall_toggle
#define SF_WALL_START_OFF 0x0001
// func_conveyor
#define SF_CONVEYOR_VISUAL 0x0001
#define SF_CONVEYOR_NOTSOLID 0x0002
// This is just a solid wall if not inhibited
class CFuncWall: public CBaseEntity {
@ -95,6 +108,7 @@ public:
// basic functions
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual void Restart() = 0;
virtual void KeyValue(KeyValueData *pkvd) = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
@ -107,6 +121,8 @@ public:
float m_flVolume;
float m_pitch;
int m_sounds;
Vector m_angles;
};
class CPendulum: public CBaseEntity {

View File

@ -338,6 +338,10 @@ public:
string_t m_globalstate;
};
#define SF_WORLD_DARK 0x0001 // Fade from black at startup
#define SF_WORLD_TITLE 0x0002 // Display game title at startup
#define SF_WORLD_FORCETEAM 0x0004 // Force teams
// This spawns first when each level begins.
class CWorld: public CBaseEntity {
public:

View File

@ -105,7 +105,7 @@ public:
virtual void KeyValue(KeyValueData *pkvd) = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual int ObjectCaps() = 0
virtual int ObjectCaps() = 0;
virtual BOOL TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) = 0;
virtual void Touch(CBaseEntity *pOther) = 0;
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) = 0;

View File

@ -31,7 +31,7 @@ enum ItemRestType
{
ITEM_TYPE_BUYING, // when a player buying items
ITEM_TYPE_TOUCHED, // when the player touches with a weaponbox or armoury_entity
ITEM_TYPE_EQUIPPED // when a entity game_player_equip gives item to player or default item's on player spawn
ITEM_TYPE_EQUIPPED // when an entity game_player_equip gives item to player or default item's on player spawn
};
// constant items

View File

@ -95,6 +95,7 @@ public:
virtual void Disappear();
virtual void MakeVIP();
virtual bool MakeBomber();
virtual void StartDeathCam();
CBasePlayer *BasePlayer() const;
public:

View File

@ -30,8 +30,12 @@
#define GRENADETYPE_SMOKE 1
#define GRENADETYPE_FLASH 2
#define SPAWNFLAG_NOMESSAGE 1
#define SPAWNFLAG_NOTOUCH 1
#define SPAWNFLAG_DROIDONLY 4
#define MAX_ITEM_COUNTS 32
#define MAX_ENTITY 512 // We can only ever move 512 entities across a transition
#define MAX_ENTITY 512 // We can only ever move 512 entities across a transition
// triggers
#define SF_TRIGGER_ALLOWMONSTERS 1 // monsters allowed to fire this trigger
@ -264,7 +268,9 @@ public:
class CTriggerPush: public CBaseTrigger {
public:
virtual void Spawn() = 0;
virtual void Restart() = 0;
virtual void KeyValue(KeyValueData *pkvd) = 0;
virtual int ObjectCaps() = 0;
virtual void Touch(CBaseEntity *pOther) = 0;
};

View File

@ -79,23 +79,6 @@ extern globalvars_t *gpGlobals;
#define SVC_ROOMTYPE 37
#define SVC_DIRECTOR 51
// func_rotating
#define SF_BRUSH_ROTATE_Y_AXIS 0
#define SF_BRUSH_ROTATE_INSTANT 1
#define SF_BRUSH_ROTATE_BACKWARDS 2
#define SF_BRUSH_ROTATE_Z_AXIS 4
#define SF_BRUSH_ROTATE_X_AXIS 8
#define SF_PENDULUM_AUTO_RETURN 16
#define SF_PENDULUM_PASSABLE 32
#define SF_BRUSH_ROTATE_SMALLRADIUS 128
#define SF_BRUSH_ROTATE_MEDIUMRADIUS 256
#define SF_BRUSH_ROTATE_LARGERADIUS 512
#define SPAWNFLAG_NOMESSAGE 1
#define SPAWNFLAG_NOTOUCH 1
#define SPAWNFLAG_DROIDONLY 4
#define VEC_HULL_MIN_Z Vector(0, 0, -36)
#define VEC_DUCK_HULL_MIN_Z Vector(0, 0, -18)

View File

@ -44,7 +44,7 @@ private:
// this was a root node
unsigned int rootId = GetRoodNodeId(node->key);
if (m_RootNodes[rootId] != node) {
Sys_Error(__FUNCTION__ ": invalid root node");
Sys_Error("%s: invalid root node", __FUNCTION__);
return;
}

View File

@ -33,6 +33,15 @@
// to help identify nav files
#define NAV_MAGIC_NUMBER 0xFEEDFACE
// version
// 1 = hiding spots as plain vector array
// 2 = hiding spots as HidingSpot objects
// 3 = Encounter spots use HidingSpot ID's instead of storing vector again
// 4 = Includes size of source bsp file to verify nav data correlation
// ---- Beta Release at V4 -----
// 5 = Added Place info
#define NAV_VERSION 5
// A place is a named group of navigation areas
typedef unsigned int Place;

View File

@ -1372,6 +1372,11 @@ cell AMX_NATIVE_CALL rg_set_user_team(AMX *amx, cell *params)
}
g_amxxapi.SetPlayerTeamInfo(args[arg_index], args[arg_team], GetTeamName(args[arg_team]));
// If team was changed to spectator, then player should be able immediately to spectate
if (args[arg_team] == SPECTATOR && !pPlayer->IsAlive()) {
pPlayer->CSPlayer()->StartDeathCam();
}
return TRUE;
}