Skip to content

Commit 0e9468a

Browse files
committed
Merge branch 'master' into opfor
2 parents ead3b77 + c2bd17f commit 0e9468a

File tree

7 files changed

+51
-19
lines changed

7 files changed

+51
-19
lines changed

dlls/maprules.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ class CRuleBrushEntity : public CRuleEntity
110110
{
111111
public:
112112
void Spawn( void );
113+
int ObjectCaps() { return CRuleEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; }
113114

114115
private:
115116
};
@@ -168,7 +169,7 @@ void CGameScore::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE us
168169
return;
169170

170171
// Only players can use this
171-
if( pActivator->IsPlayer() )
172+
if( pActivator && pActivator->IsPlayer() )
172173
{
173174
if( AwardToTeam() )
174175
{

dlls/multiplay_gamerules.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -622,11 +622,6 @@ int CHalfLifeMultiplay::IPointsForKill( CBasePlayer *pAttacker, CBasePlayer *pKi
622622
//=========================================================
623623
void CHalfLifeMultiplay::PlayerKilled( CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor )
624624
{
625-
DeathNotice( pVictim, pKiller, pInflictor );
626-
627-
pVictim->m_iDeaths += 1;
628-
629-
FireTargets( "game_playerdie", pVictim, pVictim, USE_TOGGLE, 0 );
630625
CBasePlayer *peKiller = NULL;
631626
CBaseEntity *ktmp = CBaseEntity::Instance( pKiller );
632627
if( ktmp && (ktmp->Classify() == CLASS_PLAYER ) )
@@ -642,6 +637,12 @@ void CHalfLifeMultiplay::PlayerKilled( CBasePlayer *pVictim, entvars_t *pKiller,
642637
}
643638
}
644639

640+
DeathNotice( pVictim, pKiller, pInflictor );
641+
642+
pVictim->m_iDeaths += 1;
643+
644+
FireTargets( "game_playerdie", pVictim, pVictim, USE_TOGGLE, 0 );
645+
645646
if( pVictim->pev == pKiller )
646647
{
647648
// killed self

dlls/player.cpp

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2952,13 +2952,24 @@ edict_t *EntSelectSpawnPoint( CBaseEntity *pPlayer )
29522952
CBaseEntity *pSpot;
29532953
edict_t *player;
29542954

2955+
int nNumRandomSpawnsToTry = 10;
2956+
29552957
player = pPlayer->edict();
29562958

29572959
if( !strnicmp( STRING( gpGlobals->mapname ), "op4ctf", 6 ) )
29582960
{
2961+
if( !g_pLastSpawn )
2962+
{
2963+
nNumRandomSpawnsToTry = 0;
2964+
CBaseEntity* pEnt = 0;
2965+
2966+
while( ( pEnt = UTIL_FindEntityByClassname( 0, "info_ctfspawn" )))
2967+
nNumRandomSpawnsToTry++;
2968+
}
2969+
29592970
pSpot = g_pLastSpawn;
29602971
// Randomize the start spot
2961-
for( int i = RANDOM_LONG( 1, 9 ); i > 0; i-- )
2972+
for( int i = RANDOM_LONG( 1, nNumRandomSpawnsToTry - 1 ); i > 0; i-- )
29622973
pSpot = UTIL_FindEntityByClassname( pSpot, "info_ctfspawn" );
29632974
if( FNullEnt( pSpot ) ) // skip over the null point
29642975
pSpot = UTIL_FindEntityByClassname( pSpot, "info_ctfspawn" );
@@ -3013,9 +3024,18 @@ edict_t *EntSelectSpawnPoint( CBaseEntity *pPlayer )
30133024
}
30143025
else if( g_pGameRules->IsDeathmatch() )
30153026
{
3027+
if( !g_pLastSpawn )
3028+
{
3029+
nNumRandomSpawnsToTry = 0;
3030+
CBaseEntity* pEnt = 0;
3031+
3032+
while( ( pEnt = UTIL_FindEntityByClassname( 0, "info_ctfspawn" )))
3033+
nNumRandomSpawnsToTry++;
3034+
}
3035+
30163036
pSpot = g_pLastSpawn;
30173037
// Randomize the start spot
3018-
for( int i = RANDOM_LONG( 1, 9 ); i > 0; i-- )
3038+
for( int i = RANDOM_LONG( 1, nNumRandomSpawnsToTry - 1 ); i > 0; i-- )
30193039
pSpot = UTIL_FindEntityByClassname( pSpot, "info_player_deathmatch" );
30203040
if( FNullEnt( pSpot ) ) // skip over the null point
30213041
pSpot = UTIL_FindEntityByClassname( pSpot, "info_player_deathmatch" );

dlls/rpg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ int CRpg::GetItemInfo( ItemInfo *p )
400400
p->iSlot = 3;
401401
p->iPosition = 0;
402402
p->iId = m_iId = WEAPON_RPG;
403-
p->iFlags = ITEM_FLAG_NOCHOICE;
403+
p->iFlags = ITEM_FLAG_NOAUTOSWITCHTO;
404404
p->iWeight = RPG_WEIGHT;
405405

406406
return 1;

dlls/singleplay_gamerules.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ BOOL HLGetNextBestWeapon(CBasePlayer *pPlayer, CBasePlayerItem *pCurrentWeapon )
119119

120120
while( pCheck )
121121
{
122-
if( !FBitSet( pCheck->iFlags(), ITEM_FLAG_NOCHOICE ))
122+
if( !FBitSet( pCheck->iFlags(), ITEM_FLAG_NOAUTOSWITCHTO ))
123123
{
124124
if( pCheck->iWeight() > -1 && pCheck->iWeight() == pCurrentWeapon->iWeight() && pCheck != pCurrentWeapon )
125125
{

dlls/weapons.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ typedef enum
230230
#define ITEM_FLAG_NOAUTOSWITCHEMPTY 4
231231
#define ITEM_FLAG_LIMITINWORLD 8
232232
#define ITEM_FLAG_EXHAUSTIBLE 16 // A player can totally exhaust their ammo supply and lose this weapon
233-
#define ITEM_FLAG_NOCHOICE 32
233+
#define ITEM_FLAG_NOAUTOSWITCHTO 32
234234

235235
#define WEAPON_IS_ONTARGET 0x40
236236

pm_shared/pm_shared.c

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,10 @@ int PM_FlyMove( void )
972972

973973
// modify original_velocity so it parallels all of the clip planes
974974
//
975-
if( pmove->movetype == MOVETYPE_WALK && ( ( pmove->onground == -1 ) || ( pmove->friction != 1 ) ) ) // relfect player velocity
975+
// reflect player velocity
976+
// Only give this a try for first impact plane because you can get yourself stuck in an acute corner by jumping in place
977+
// and pressing forward and nobody was really using this bounce/reflection feature anyway...
978+
if( numplanes == 1 && pmove->movetype == MOVETYPE_WALK && ( ( pmove->onground == -1 ) || ( pmove->friction != 1 )))
976979
{
977980
for( i = 0; i < numplanes; i++ )
978981
{
@@ -2886,6 +2889,15 @@ void PM_CheckParamters( void )
28862889
pmove->maxspeed = min( maxspeed, pmove->maxspeed );
28872890
}
28882891

2892+
// Slow down, I'm pulling it! (a box maybe) but only when I'm standing on ground
2893+
//
2894+
// JoshA: Moved this to CheckParamters rather than working on the velocity,
2895+
// as otherwise it affects every integration step incorrectly.
2896+
if( ( pmove->onground != -1 ) && ( pmove->cmd.buttons & IN_USE ))
2897+
{
2898+
pmove->maxspeed *= 1.0f / 3.0f;
2899+
}
2900+
28892901
if( ( spd != 0.0f ) && ( spd > pmove->maxspeed ) )
28902902
{
28912903
float fRatio = pmove->maxspeed / spd;
@@ -3006,7 +3018,11 @@ void PM_PlayerMove( qboolean server )
30063018
{
30073019
if( PM_CheckStuck() )
30083020
{
3009-
return; // Can't move, we're stuck
3021+
// Let the user try to duck to get unstuck
3022+
PM_Duck();
3023+
3024+
if( PM_CheckStuck() )
3025+
return; // Can't move, we're stuck
30103026
}
30113027
}
30123028

@@ -3052,12 +3068,6 @@ void PM_PlayerMove( qboolean server )
30523068
}
30533069
}
30543070

3055-
// Slow down, I'm pulling it! (a box maybe) but only when I'm standing on ground
3056-
if( ( pmove->onground != -1 ) && ( pmove->cmd.buttons & IN_USE ) )
3057-
{
3058-
VectorScale( pmove->velocity, 0.3, pmove->velocity );
3059-
}
3060-
30613071
// Handle movement
30623072
switch( pmove->movetype )
30633073
{

0 commit comments

Comments
 (0)