mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-03-13 05:51:19 +00:00
Reduce stack usage.
This commit is contained in:
parent
be58a0c4da
commit
2ab19d6022
@ -36,7 +36,7 @@ CHeavyRainplay :: CHeavyRainplay()
|
|||||||
|
|
||||||
BOOL CHeavyRainplay::IsHeavyRain()
|
BOOL CHeavyRainplay::IsHeavyRain()
|
||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHeavyRainplay::PlayerSpawn( CBasePlayer *pPlayer )
|
void CHeavyRainplay::PlayerSpawn( CBasePlayer *pPlayer )
|
||||||
@ -74,8 +74,7 @@ void CHeavyRainplay::PlayerKilled( CBasePlayer *pVictim, entvars_t *pKiller, ent
|
|||||||
if ( pVictim->pev == pKiller )
|
if ( pVictim->pev == pKiller )
|
||||||
{ // killed self
|
{ // killed self
|
||||||
pVictim->pev->frags -= 10;
|
pVictim->pev->frags -= 10;
|
||||||
char victext[1024] = "You sacrificed your life for Jason\nYou lose 10 Jasons for revival costs.\n";
|
UTIL_SayText( "You sacrificed your life for Jason\nYou lose 10 Jasons for revival costs.\n", pVictim );
|
||||||
UTIL_SayText( victext, pVictim );
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if ( ktmp && ktmp->IsPlayer() )
|
else if ( ktmp && ktmp->IsPlayer() )
|
||||||
@ -84,16 +83,15 @@ void CHeavyRainplay::PlayerKilled( CBasePlayer *pVictim, entvars_t *pKiller, ent
|
|||||||
pKiller->frags += JasonsStolen(FUCK);
|
pKiller->frags += JasonsStolen(FUCK);
|
||||||
pVictim->pev->frags -= JasonsStolen(FUCK);
|
pVictim->pev->frags -= JasonsStolen(FUCK);
|
||||||
|
|
||||||
char victext[1024] = "You lose your Jasons to the killer.\nKILL HIM AND GET THEM BACK! ;)\n";
|
UTIL_SayText( "You lose your Jasons to the killer.\nKILL HIM AND GET THEM BACK! ;)\n", pVictim );
|
||||||
UTIL_SayText( victext, pVictim );
|
|
||||||
|
|
||||||
MESSAGE_BEGIN( MSG_ALL, gmsgScoreInfo );
|
MESSAGE_BEGIN( MSG_ALL, gmsgScoreInfo );
|
||||||
WRITE_BYTE( ENTINDEX(pVictim->edict()) );
|
WRITE_BYTE( ENTINDEX(pVictim->edict()) );
|
||||||
WRITE_SHORT( pVictim->pev->frags );
|
WRITE_SHORT( pVictim->pev->frags );
|
||||||
WRITE_SHORT( pVictim->m_iDeaths );
|
WRITE_SHORT( pVictim->m_iDeaths );
|
||||||
WRITE_SHORT( 0 );
|
WRITE_SHORT( 0 );
|
||||||
WRITE_SHORT( g_pGameRules->GetTeamIndex( pVictim->m_szTeamName ) + 1 );
|
WRITE_SHORT( g_pGameRules->GetTeamIndex( pVictim->m_szTeamName ) + 1 );
|
||||||
WRITE_SHORT( pVictim->m_fHSDev );
|
WRITE_SHORT( pVictim->m_fHSDev );
|
||||||
MESSAGE_END();
|
MESSAGE_END();
|
||||||
|
|
||||||
CBaseEntity *ep = CBaseEntity::Instance( pKiller );
|
CBaseEntity *ep = CBaseEntity::Instance( pKiller );
|
||||||
@ -101,8 +99,7 @@ void CHeavyRainplay::PlayerKilled( CBasePlayer *pVictim, entvars_t *pKiller, ent
|
|||||||
{
|
{
|
||||||
CBasePlayer *PK = (CBasePlayer*)ep;
|
CBasePlayer *PK = (CBasePlayer*)ep;
|
||||||
|
|
||||||
char kiltext[1024] = "You stole your victim's Jasons and it is now added to your score.\nNo doubt hes out for blood, watch out ;)\n";
|
UTIL_SayText( "You stole your victim's Jasons and it is now added to your score.\nNo doubt hes out for blood, watch out ;)\n", PK );
|
||||||
UTIL_SayText( kiltext, PK );
|
|
||||||
|
|
||||||
MESSAGE_BEGIN( MSG_ALL, gmsgScoreInfo );
|
MESSAGE_BEGIN( MSG_ALL, gmsgScoreInfo );
|
||||||
WRITE_BYTE( ENTINDEX(PK->edict()) );
|
WRITE_BYTE( ENTINDEX(PK->edict()) );
|
||||||
@ -125,5 +122,5 @@ void CHeavyRainplay::PlayerKilled( CBasePlayer *pVictim, entvars_t *pKiller, ent
|
|||||||
|
|
||||||
int CHeavyRainplay::JasonsStolen(int jason)
|
int CHeavyRainplay::JasonsStolen(int jason)
|
||||||
{
|
{
|
||||||
return jason; //JASON! I found you!
|
return jason; //JASON! I found you!
|
||||||
}
|
}
|
||||||
|
@ -415,17 +415,17 @@ void CHalfLifeShytplay :: PlayerKilled( CBasePlayer *pVictim, entvars_t *pKiller
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char text[1024];
|
const char *pText;
|
||||||
switch(RANDOM_LONG(0,4))
|
switch(RANDOM_LONG(0,4))
|
||||||
{
|
{
|
||||||
case 0: sprintf( text, "Super Bitchy Admin: FAGGOT!\n" ); break;
|
case 0: pText = "Super Bitchy Admin: FAGGOT!\n"; break;
|
||||||
case 1: sprintf( text, "Super Bitchy Admin: OBVIOUS HACKER\n" ); break;
|
case 1: pText = "Super Bitchy Admin: OBVIOUS HACKER\n"; break;
|
||||||
case 2: sprintf( text, "Super Bitchy Admin: EAT SHIT IN THE BAN LIST MOTHERFUCKER!\n" ); break;
|
case 2: pText = "Super Bitchy Admin: EAT SHIT IN THE BAN LIST MOTHERFUCKER!\n"; break;
|
||||||
case 3: sprintf( text, "Super Bitchy Admin: FUCK YOU!\n" ); break;
|
case 3: pText = "Super Bitchy Admin: FUCK YOU!\n"; break;
|
||||||
case 4: sprintf( text, "Super Bitchy Admin: THIS AIN'T CALL OF DUTY! DON'T FIRE YOUR GUNS, AGAINST SERVER RULES!\n" ); break;
|
case 4: pText = "Super Bitchy Admin: THIS AIN'T CALL OF DUTY! DON'T FIRE YOUR GUNS, AGAINST SERVER RULES!\n"; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
UTIL_SayTextAll( text, pVictim );
|
UTIL_SayTextAll( pText, pVictim );
|
||||||
|
|
||||||
char cmd[40];
|
char cmd[40];
|
||||||
sprintf(cmd, "kick \"%s\"\n", STRING(pKiller->netname));
|
sprintf(cmd, "kick \"%s\"\n", STRING(pKiller->netname));
|
||||||
|
@ -86,32 +86,30 @@ void CTestplay::PlayerKilled( CBasePlayer *pVictim, entvars_t *pKiller, entvars_
|
|||||||
{
|
{
|
||||||
CBasePlayer *peKiller = NULL;
|
CBasePlayer *peKiller = NULL;
|
||||||
CBaseEntity *ktmp = CBaseEntity::Instance( pKiller );
|
CBaseEntity *ktmp = CBaseEntity::Instance( pKiller );
|
||||||
if ( pVictim->pev == pKiller )
|
if( pVictim->pev == pKiller )
|
||||||
{ // killed self
|
{
|
||||||
char victext[1024] = "You killed yourself.\n";
|
// killed self
|
||||||
UTIL_SayText( victext, pVictim );
|
UTIL_SayText( "You killed yourself.\n", pVictim );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if ( ktmp && ktmp->IsPlayer() )
|
else if ( ktmp && ktmp->IsPlayer() )
|
||||||
{
|
{
|
||||||
|
UTIL_SayText( "You got shot and died.\n", pVictim );
|
||||||
|
|
||||||
char victext[1024] = "You got shot and died.\n";
|
CBaseEntity *ep = CBaseEntity::Instance( pKiller );
|
||||||
UTIL_SayText( victext, pVictim );
|
|
||||||
|
|
||||||
CBaseEntity *ep = CBaseEntity::Instance( pKiller );
|
if ( ep && ep->Classify() == CLASS_PLAYER )
|
||||||
if ( ep && ep->Classify() == CLASS_PLAYER )
|
{
|
||||||
{
|
CBasePlayer *PK = (CBasePlayer*)ep;
|
||||||
CBasePlayer *PK = (CBasePlayer*)ep;
|
|
||||||
|
|
||||||
char kiltext[1024] = "You killed a person.\n";
|
UTIL_SayText( "You killed a person.\n", PK );
|
||||||
UTIL_SayText( kiltext, PK );
|
|
||||||
|
|
||||||
PK->m_flNextDecalTime = gpGlobals->time;
|
PK->m_flNextDecalTime = gpGlobals->time;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// World did them in, Genuflect.
|
// World did them in, Genuflect.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user