mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-02-02 10:05:38 +00:00
Optionally fix hornet bug
This commit is contained in:
parent
0750a76fb5
commit
26bec53193
@ -27,6 +27,7 @@ extern cvar_t mp_semclip;
|
||||
extern cvar_t mp_coop_reconnect_hack;
|
||||
extern cvar_t mp_coop_noangry;
|
||||
extern cvar_t mp_spectator;
|
||||
extern cvar_t mp_fixhornetbug;
|
||||
|
||||
extern cvar_t sentences_txt;
|
||||
extern cvar_t materials_txt;
|
||||
|
@ -63,6 +63,7 @@ cvar_t mp_coop_strongcheckpoints = { "mp_coop_strongcheckpoints", "0", FCVAR_SER
|
||||
cvar_t mp_unduck = { "mp_unduck", "0", FCVAR_SERVER };
|
||||
cvar_t mp_semclip = { "mp_semclip", "0", FCVAR_SERVER };
|
||||
cvar_t mp_spectator = { "mp_spectator", "0", FCVAR_SERVER };
|
||||
cvar_t mp_fixhornetbug = { "mp_fixhornetbug", "0", FCVAR_SERVER };
|
||||
|
||||
cvar_t materials_txt = { "materials_txt", "sound/materials.txt", FCVAR_SERVER };
|
||||
cvar_t sentences_txt = { "sentences_txt", "sound/sentences.txt", FCVAR_SERVER };
|
||||
@ -520,6 +521,7 @@ void GameDLLInit( void )
|
||||
CVAR_REGISTER( &mp_coop_checkpoints );
|
||||
CVAR_REGISTER( &mp_skipdefaults );
|
||||
CVAR_REGISTER( &mp_coop_strongcheckpoints );
|
||||
CVAR_REGISTER( &mp_fixhornetbug );
|
||||
|
||||
|
||||
CVAR_REGISTER( &sentences_txt );
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "soundent.h"
|
||||
#include "hornet.h"
|
||||
#include "gamerules.h"
|
||||
#include "game.h"
|
||||
|
||||
int iHornetTrail;
|
||||
int iHornetPuff;
|
||||
@ -407,7 +408,7 @@ void CHornet::DartTouch( CBaseEntity *pOther )
|
||||
|
||||
void CHornet::DieTouch( CBaseEntity *pOther )
|
||||
{
|
||||
if( pOther && pOther->pev->takedamage )
|
||||
if( pOther && pOther->pev->takedamage && gpGlobals->time > pev->dmgtime )
|
||||
{
|
||||
// do the damage
|
||||
switch( RANDOM_LONG( 0, 2 ) )
|
||||
@ -426,7 +427,15 @@ void CHornet::DieTouch( CBaseEntity *pOther )
|
||||
|
||||
if( !pev->owner )
|
||||
pev->owner = edict();
|
||||
if( mp_fixhornetbug.value )
|
||||
{
|
||||
pev->dmgtime = gpGlobals->time + 0.1;
|
||||
// !finitef( pev->dmf )
|
||||
if( ((*(int *)&( pev->dmg ) & 0x7f800000L) == 0x7f800000L) )
|
||||
pev->dmg = 0;
|
||||
}
|
||||
pOther->TakeDamage( pev, VARS( pev->owner ), pev->dmg, DMG_BULLET );
|
||||
|
||||
}
|
||||
|
||||
pev->modelindex = 0;// so will disappear for the 0.1 secs we wait until NEXTTHINK gets rid
|
||||
|
Loading…
x
Reference in New Issue
Block a user