Skip to content

Commit 5d12586

Browse files
committed
Merge branch 'master' into bshift
2 parents 8b57dd9 + c2bd17f commit 5d12586

File tree

7 files changed

+41
-18
lines changed

7 files changed

+41
-18
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
@@ -580,11 +580,6 @@ int CHalfLifeMultiplay::IPointsForKill( CBasePlayer *pAttacker, CBasePlayer *pKi
580580
//=========================================================
581581
void CHalfLifeMultiplay::PlayerKilled( CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor )
582582
{
583-
DeathNotice( pVictim, pKiller, pInflictor );
584-
585-
pVictim->m_iDeaths += 1;
586-
587-
FireTargets( "game_playerdie", pVictim, pVictim, USE_TOGGLE, 0 );
588583
CBasePlayer *peKiller = NULL;
589584
CBaseEntity *ktmp = CBaseEntity::Instance( pKiller );
590585
if( ktmp && (ktmp->Classify() == CLASS_PLAYER ) )
@@ -600,6 +595,12 @@ void CHalfLifeMultiplay::PlayerKilled( CBasePlayer *pVictim, entvars_t *pKiller,
600595
}
601596
}
602597

598+
DeathNotice( pVictim, pKiller, pInflictor );
599+
600+
pVictim->m_iDeaths += 1;
601+
602+
FireTargets( "game_playerdie", pVictim, pVictim, USE_TOGGLE, 0 );
603+
603604
if( pVictim->pev == pKiller )
604605
{
605606
// killed self

dlls/player.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2794,6 +2794,8 @@ edict_t *EntSelectSpawnPoint( CBaseEntity *pPlayer )
27942794
CBaseEntity *pSpot;
27952795
edict_t *player;
27962796

2797+
int nNumRandomSpawnsToTry = 10;
2798+
27972799
player = pPlayer->edict();
27982800

27992801
// choose a info_player_deathmatch point
@@ -2808,9 +2810,18 @@ edict_t *EntSelectSpawnPoint( CBaseEntity *pPlayer )
28082810
}
28092811
else if( g_pGameRules->IsDeathmatch() )
28102812
{
2813+
if( !g_pLastSpawn )
2814+
{
2815+
nNumRandomSpawnsToTry = 0;
2816+
CBaseEntity* pEnt = 0;
2817+
2818+
while( ( pEnt = UTIL_FindEntityByClassname( 0, "info_player_deathmatch" )))
2819+
nNumRandomSpawnsToTry++;
2820+
}
2821+
28112822
pSpot = g_pLastSpawn;
28122823
// Randomize the start spot
2813-
for( int i = RANDOM_LONG( 1, 9 ); i > 0; i-- )
2824+
for( int i = RANDOM_LONG( 1, nNumRandomSpawnsToTry - 1 ); i > 0; i-- )
28142825
pSpot = UTIL_FindEntityByClassname( pSpot, "info_player_deathmatch" );
28152826
if( FNullEnt( pSpot ) ) // skip over the null point
28162827
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
@@ -183,7 +183,7 @@ typedef enum
183183
#define ITEM_FLAG_NOAUTOSWITCHEMPTY 4
184184
#define ITEM_FLAG_LIMITINWORLD 8
185185
#define ITEM_FLAG_EXHAUSTIBLE 16 // A player can totally exhaust their ammo supply and lose this weapon
186-
#define ITEM_FLAG_NOCHOICE 32
186+
#define ITEM_FLAG_NOAUTOSWITCHTO 32
187187

188188
#define WEAPON_IS_ONTARGET 0x40
189189

pm_shared/pm_shared.c

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

947947
// modify original_velocity so it parallels all of the clip planes
948948
//
949-
if( pmove->movetype == MOVETYPE_WALK && ( ( pmove->onground == -1 ) || ( pmove->friction != 1 ) ) ) // relfect player velocity
949+
// reflect player velocity
950+
// Only give this a try for first impact plane because you can get yourself stuck in an acute corner by jumping in place
951+
// and pressing forward and nobody was really using this bounce/reflection feature anyway...
952+
if( numplanes == 1 && pmove->movetype == MOVETYPE_WALK && ( ( pmove->onground == -1 ) || ( pmove->friction != 1 )))
950953
{
951954
for( i = 0; i < numplanes; i++ )
952955
{
@@ -2860,6 +2863,15 @@ void PM_CheckParamters( void )
28602863
pmove->maxspeed = min( maxspeed, pmove->maxspeed );
28612864
}
28622865

2866+
// Slow down, I'm pulling it! (a box maybe) but only when I'm standing on ground
2867+
//
2868+
// JoshA: Moved this to CheckParamters rather than working on the velocity,
2869+
// as otherwise it affects every integration step incorrectly.
2870+
if( ( pmove->onground != -1 ) && ( pmove->cmd.buttons & IN_USE ))
2871+
{
2872+
pmove->maxspeed *= 1.0f / 3.0f;
2873+
}
2874+
28632875
if( ( spd != 0.0f ) && ( spd > pmove->maxspeed ) )
28642876
{
28652877
float fRatio = pmove->maxspeed / spd;
@@ -2980,7 +2992,11 @@ void PM_PlayerMove( qboolean server )
29802992
{
29812993
if( PM_CheckStuck() )
29822994
{
2983-
return; // Can't move, we're stuck
2995+
// Let the user try to duck to get unstuck
2996+
PM_Duck();
2997+
2998+
if( PM_CheckStuck() )
2999+
return; // Can't move, we're stuck
29843000
}
29853001
}
29863002

@@ -3026,12 +3042,6 @@ void PM_PlayerMove( qboolean server )
30263042
}
30273043
}
30283044

3029-
// Slow down, I'm pulling it! (a box maybe) but only when I'm standing on ground
3030-
if( ( pmove->onground != -1 ) && ( pmove->cmd.buttons & IN_USE ) )
3031-
{
3032-
VectorScale( pmove->velocity, 0.3, pmove->velocity );
3033-
}
3034-
30353045
// Handle movement
30363046
switch( pmove->movetype )
30373047
{

0 commit comments

Comments
 (0)